Peter has a sequence of integers a1, a2, ..., an. Peter wants all numbers in the sequence to equal h. He can perform the operation of "adding one on the segment [l, r]": add one to all elements of the sequence with indices from l to r (inclusive). At that, Peter never chooses any element as the beginning of the segment twice. Similarly, Peter never chooses any element as the end of the segment twice. In other words, for any two segments [l1, r1] and [l2, r2], where Peter added one, the following inequalities hold: l1 ≠ l2 and r1 ≠ r2.

How many distinct ways are there to make all numbers in the sequence equal h? Print this number of ways modulo 1000000007 (109 + 7). Two ways are considered distinct if one of them has a segment that isn't in the other way.

Input

The first line contains two integers n, h (1 ≤ n, h ≤ 2000). The next line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 2000).

Output

Print a single integer — the answer to the problem modulo 1000000007 (109 + 7).

Examples

Input

3 2
1 1 1


Output

4


Input

5 1
1 1 1 1 1


Output

1


Input

4 3
3 2 1 1


Output

0
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;

public class Main
{
	public static void main(String[] args) {
		new Thread(null, new Runnable() {
			public void run() {
                solve();
            }
        }, "1", 1 << 26).start();
	}
	static void solve () {
		FastReader fr =new FastReader();	PrintWriter op =new PrintWriter(System.out);
 
 		int n =fr.nextInt() ,h =fr.nextInt() ,a[] =new int[n+1] ,i ,j ;
 		for (i =1 ; i<=n ; ++i)	a[i] =fr.nextInt() ;

 		long dp[][] =new long[n+2][h+2] ,mod =1000000007l ;

 		dp[0][0] =1l ;

 		for (i =1 ; i<=n ; ++i) {
 			j =Math.max(0 , h-a[i]) ;

 			if (j==0) {
 				dp[i][0] += dp[i-1][0] ;

 				dp[i][0] %= mod ;

 				continue ;
 			}

 			dp[i][j] += dp[i-1][j] ;

 			dp[i][j] %= mod ;

 			dp[i][j-1] += ((long)j * dp[i-1][j])%mod ;

 			dp[i][j-1] %= mod ;

 			dp[i][j] += dp[i-1][j-1] ;

 			dp[i][j] %= mod ;

 			dp[i][j-1]  += ((long)j * dp[i-1][j-1])%mod ;

 			dp[i][j-1] %= mod ;
 		}

		op.println(dp[n][0]) ;	op.flush();	op.close();
	}
	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br =new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st==null || (!st.hasMoreElements())) 
			{
				try
				{
					st =new StringTokenizer(br.readLine());
				}
				catch(IOException e)
				{
					e.printStackTrace();
				}
				
			}
			return st.nextToken();
		}

		String nextLine() {
			String str ="";

			try
			{
				str =br.readLine();
			}
			catch(IOException e)
			{
				e.printStackTrace();
			}

			return str;
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next()) ;
		}
	}
}