{"raw_statement":[{"iden":"problem statement","content":"Takahashi is at the origin of a two-dimensional plane.  \nTakahashi will repeat teleporting $N$ times. In each teleportation, he makes one of the following moves:\n\n*   Move from the current coordinates $(x,y)$ to $(x+A,y+B)$\n*   Move from the current coordinates $(x,y)$ to $(x+C,y+D)$\n*   Move from the current coordinates $(x,y)$ to $(x+E,y+F)$\n\nThere are obstacles on $M$ points $(X_1,Y_1),\\ldots,(X_M,Y_M)$ on the plane; he cannot teleport to these coordinates.\nHow many paths are there resulting from the $N$ teleportations? Find the count modulo $998244353$."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 300$\n*   $0 \\leq M \\leq 10^5$\n*   $-10^9 \\leq A,B,C,D,E,F \\leq 10^9$\n*   $(A,B)$, $(C,D)$, and $(E,F)$ are distinct.\n*   $-10^9 \\leq X_i,Y_i \\leq 10^9$\n*   $(X_i,Y_i)\\neq(0,0)$\n*   $(X_i,Y_i)$ are distinct.\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $M$\n$A$ $B$ $C$ $D$ $E$ $F$\n$X_1$ $Y_1$\n$X_2$ $Y_2$\n$\\vdots$\n$X_M$ $Y_M$"},{"iden":"sample input 1","content":"2 2\n1 1 1 2 1 3\n1 2\n2 2"},{"iden":"sample output 1","content":"5\n\nThe following $5$ paths are possible:\n\n*   $(0,0)\\to(1,1)\\to(2,3)$\n*   $(0,0)\\to(1,1)\\to(2,4)$\n*   $(0,0)\\to(1,3)\\to(2,4)$\n*   $(0,0)\\to(1,3)\\to(2,5)$\n*   $(0,0)\\to(1,3)\\to(2,6)$"},{"iden":"sample input 2","content":"10 3\n-1000000000 -1000000000 1000000000 1000000000 -1000000000 1000000000\n-1000000000 -1000000000\n1000000000 1000000000\n-1000000000 1000000000"},{"iden":"sample output 2","content":"0"},{"iden":"sample input 3","content":"300 0\n0 0 1 0 0 1"},{"iden":"sample output 3","content":"292172978"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}