#include <bits/stdc++.h>
using namespace std;
long long int dp[105][100005], arr[105];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long int i, j, k, a, b, ans = 0, sum = 0, cnt = 0, n;
  cin >> n >> k;
  for (i = 1; i <= n; i++) {
    cin >> arr[i];
  }
  sort(arr + 1, arr + n + 1);
  for (i = 1; i <= n; i++) dp[i][0] = 1;
  for (i = 0; i <= k; i++) dp[0][i] = 0;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= k; j++) {
      dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % 1000000007;
      if (j > arr[i]) {
        dp[i][j] = (dp[i][j] - 1) % 1000000007;
        break;
      }
    }
  cout << dp[n][k] << endl;
  return 0;
}
