#include <bits/stdc++.h>
using namespace std;
int main(){
    int n,k;
    cin>>n>>k;
    long long int arr[n] ={0};
    for(int i = 0; i<n;i++) cin>>arr[i];
    sort(arr,arr+n);
    long long int dp[n][k+1];
    long long int a = 0;
    for(int i = 0;i<=k;i++){
        if(i<=arr[0]) dp[0][i] = 1;
        else{
            dp[0][i] = a;
            a--;
        }
        //cout<<dp[0][i]<<" ";
    } 
   // cout<<"\n";
    for(int i = 0;i<n;i++) dp[i][0] = 1;
    for(int i = 1;i<n;i++){
        for(int j = 1;j<=k;j++){
            dp[i][j] = (dp[i-1][j]+dp[i][j-1])%(1000000007);
            //cout<<dp[i][j]<<" ";
        }
       // cout<<"\n";
    }
    if(dp[n-1][k]>0) cout<<dp[n-1][k];
    else cout<<"0";
   }

