There are N sheets of paper, enumerated by sequential integers from 1 to N. Each sheet has K integers written on it, so i-th sheet contains the integers v_i,1,v_i,2,…,v_i,K.
Then we choose one integer from each sheet and create the sequence a_i, where i-th integer is chosen from i-th sheet of paper. There are KN ways to make such a sequence. How many of them are non-decreasing? A sequence is non-decreasing if a_i≤a_i+1 for all 1≤i≤N−1.
The answer may be too large, so print it modulo 109+7.
The first line of the input contains two integers N and K (1≤N≤100, 1≤K≤104). The i-th of the following N lines contains K integers v_i,1,v_i,2,…,v_i,K (1≤v_i,1<v_i,2<…<v_i,K≤109).
Print the number of non-decreasing sequences, modulo 109+7.