#include <bits/stdc++.h>
using namespace std;
void fastio() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
int n, k, j;
int a[105], dp[101][100005];
int solve(int idx, int k1) {
  if (k1 == 0) return 1;
  if (idx == n) {
    return k1 == 0;
  }
  if (dp[idx][k1] != -1) return dp[idx][k1];
  long long int ans = 0;
  ans = solve(idx + 1, k1) + solve(idx, k1 - 1);
  ans %= 1000000007;
  dp[idx][k1] = ans;
  return ans;
}
int main() {
  fastio();
  memset(dp, -1, sizeof dp);
  cin >> n >> k;
  for (j = 0; j < n; j++) cin >> a[j];
  long long int ans = solve(0, k);
  cout << ans << endl;
  return 0;
}
