#include <bits/stdc++.h>
using namespace std;
bool check(long long i, long long j, long long row, long long col) {
  if (i < 1 || i > row) return false;
  if (j < 0 || j > col) return false;
  return true;
}
void printmat(vector<vector<long long> >& dp, long long r, long long c) {
  for (long long i = 1; i <= r; i++) {
    for (long long j = 0; j <= c; j++) {
      cout << dp[i][j] << " ";
    }
    cout << endl;
  }
}
int main() {
  long long n, k;
  cin >> n >> k;
  vector<long long> a(n);
  vector<vector<long long> > dp(n + 1);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (long long i = 0; i <= n; i++) {
    dp[i].resize(k + 1, 0);
  }
  long long tways = 0;
  dp[1][0] = dp[1][1] = 1;
  for (long long j = 1; j <= n; j++) {
    dp[j][0] = 1;
  }
  for (long long i = 2; i <= n; i++) {
    for (long long j = 1; j <= k; j++) {
      tways = 0;
      for (long long l = j; l >= j - i; l--) {
        if (check(i - 1, l, n, k)) {
          tways = (tways + dp[i - 1][l]) % 1000000007;
        }
      }
      dp[i][j] = tways;
    }
  }
  cout << dp[n][k] << endl;
  return 0;
}
