题目描述
Given is a sequence of $N$ integers: $A = (A_1, A_2, \dots, A_N)$.
Find the number of (not necessarily contiguous) subsequences $A'=(A'_1,A'_2,\ldots,A'_k)$ of length at least $2$ that satisfy the following condition:
- $A'_1 \leq A'_k$.
Since the count can be enormous, print it modulo $998244353$.
Here, two subsequences are distinguished when they originate from different sets of indices, even if they are the same as sequences.
输出格式
Print the number of (not necessarily contiguous) subsequences $A'=(A'_1,A'_2,\ldots,A'_k)$ of length at least $2$ that satisfy the condition in Problem Statement.