{"raw_statement":[{"iden":"problem statement","content":"There is a knight - the chess piece - at the origin $(0, 0)$ of a two-dimensional grid.\nWhen the knight is at the square $(i, j)$, it can be moved to either $(i+1,j+2)$ or $(i+2, j+1)$.\nIn how many ways can the knight reach the square $(X, Y)$?\nFind the number of ways modulo $10^9 + 7$."},{"iden":"constraints","content":"*   $1 \\leq X \\leq 10^6$\n*   $1 \\leq Y \\leq 10^6$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$X$ $Y$"},{"iden":"sample input 1","content":"3 3"},{"iden":"sample output 1","content":"2\n\nThere are two ways: $(0,0) \\to (1,2) \\to (3,3)$ and $(0,0) \\to (2,1) \\to (3,3)$."},{"iden":"sample input 2","content":"2 2"},{"iden":"sample output 2","content":"0\n\nThe knight cannot reach $(2,2)$."},{"iden":"sample input 3","content":"999999 999999"},{"iden":"sample output 3","content":"151840682\n\nPrint the number of ways modulo $10^9 + 7$."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}