Isaac has a decimal integer a_1a_2…a_n, possibly with leading zeroes. He knows that for m ranges \[l_1,r_1],\[l_2,r_2],…,\[l_m,r_m], it holds that a_l_i×a_l_i+1×⋯×a_r_imod9=0. Find the number of valid integers a_1a_2…a_n, modulo (109+7).
The input consists of several test cases and is terminated by end-of-file.
The first line of each test case contains two integers n and m.
The ith of the following m lines contains two integers l_i and r_i.
For each test case, print an integer which denotes the result.