{"raw_statement":[{"iden":"problem statement","content":"$N$ problems have been chosen by the judges, now it's time to assign scores to them!\nProblem $i$ must get an integer score $A_i$ between $1$ and $N$, inclusive. The problems have already been sorted by difficulty: $A_1 \\le A_2 \\le \\ldots \\le A_N$ must hold. Different problems can have the same score, though.\nBeing an ICPC fan, you want contestants who solve more problems to be ranked higher. That's why, for any $k$ ($1 \\le k \\le N-1$), you want the sum of scores of any $k$ problems to be strictly less than the sum of scores of any $k+1$ problems.\nHow many ways to assign scores do you have? Find this number modulo the given prime $M$."},{"iden":"constraints","content":"*   $2 \\leq N \\leq 5000$\n*   $9 \\times 10^8 < M < 10^9$\n*   $M$ is a prime.\n*   All input values are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $M$"},{"iden":"sample input 1","content":"2 998244353"},{"iden":"sample output 1","content":"3\n\nThe possible assignments are $(1, 1)$, $(1, 2)$, $(2, 2)$."},{"iden":"sample input 2","content":"3 998244353"},{"iden":"sample output 2","content":"7\n\nThe possible assignments are $(1, 1, 1)$, $(1, 2, 2)$, $(1, 3, 3)$, $(2, 2, 2)$, $(2, 2, 3)$, $(2, 3, 3)$, $(3, 3, 3)$."},{"iden":"sample input 3","content":"6 966666661"},{"iden":"sample output 3","content":"66"},{"iden":"sample input 4","content":"96 925309799"},{"iden":"sample output 4","content":"83779"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}