{"raw_statement":[{"iden":"problem statement","content":"You are given a multiset of positive integers with $N$ elements: $A=\\lbrace A_1,A_2,\\dots,A_N \\rbrace$.\nYou may repeat the following operation any number of times (possibly zero).\n\n*   Choose a positive integer $x$ that occurs at least twice in $A$. Delete two occurrences of $x$ from $A$, and add one occurrence of $x+1$ to $A$.\n\nFind the number, modulo $998244353$, of multisets that $A$ can be in the end."},{"iden":"constraints","content":"*   $1 \\le N \\le 2 \\times 10^5$\n*   $1 \\le A_i \\le 2 \\times 10^5$"},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $\\dots$ $A_N$"},{"iden":"sample input 1","content":"4\n1 1 2 4"},{"iden":"sample output 1","content":"3\n\n$A$ can be one of the three multisets $\\lbrace 1,1,2,4 \\rbrace,\\lbrace 2,2,4 \\rbrace,\\lbrace 3,4 \\rbrace$ in the end.\nYou can make $A = \\lbrace 3,4 \\rbrace$ as follows.\n\n*   Choose $x = 1$. Delete two $1$s from $A$ and add one $2$ to $A$, making $A=\\lbrace 2,2,4 \\rbrace$.\n*   Choose $x = 2$. Delete two $2$s from $A$ and add one $3$ to $A$, making $A=\\lbrace 3,4 \\rbrace$."},{"iden":"sample input 2","content":"5\n1 2 3 4 5"},{"iden":"sample output 2","content":"1"},{"iden":"sample input 3","content":"13\n3 1 4 1 5 9 2 6 5 3 5 8 9"},{"iden":"sample output 3","content":"66"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}