{"raw_statement":[{"iden":"problem statement","content":"Given is a sequence of $N$ integers $A_1,A_2,\\cdots,A_N$.\nFind the number of non-empty subsequences $s$ of $A$ satisfying the following condition, modulo $998244353$.\n\n*   There is only one way to extract $s$ from $A$. Formally, there uniquely exists a sequence of indices $1 \\leq idx(1)<idx(2)<\\cdots<idx(k) \\leq N$ such that $A_{idx(i)}=s_i$ ($1 \\leq i \\leq k$), where $s=(s_1,s_2,\\cdots,s_k)$."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 2 \\times 10^5$\n*   $1 \\leq A_i \\leq N$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $\\cdots$ $A_N$"},{"iden":"sample input 1","content":"3\n1 2 1"},{"iden":"sample output 1","content":"5\n\nThe following five subsequences satisfy the condition.\n\n*   $(1,1)$\n*   $(1,2)$\n*   $(1,2,1)$\n*   $(2)$\n*   $(2,1)$\n\nThe subsequence $(1)$ does not satisfy the condition since there are two ways to extract it."},{"iden":"sample input 2","content":"4\n4 2 1 3"},{"iden":"sample output 2","content":"15"},{"iden":"sample input 3","content":"12\n1 2 3 6 9 2 3 3 9 6 1 6"},{"iden":"sample output 3","content":"1178"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}