#include <bits/stdc++.h>
using namespace std;
int C[120][120];
void make_nCr() {
  C[0][0] = 1;
  for (int i = 0; i < 120; i++) {
    for (int j = 0; j <= i; j++) {
      if (j == 0 || i == j)
        C[i][j] = 1;
      else
        C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % 1000000007;
    }
  }
}
int memo[120][10], cnt[10];
long long int solve(int len, int j) {
  if (len < 0) return 0;
  if (j == 9)
    if (len >= cnt[j])
      return 1;
    else
      return 0;
  if (memo[len][j] != -1) return memo[len][j];
  long long int ret = 0;
  if (j == 0) {
    for (int k = cnt[0]; k <= len; k++) {
      ret += solve(len - k, 1) * C[len - 1][k];
      ret %= 1000000007;
    }
  } else {
    for (int k = cnt[j]; k <= len; k++) {
      ret += solve(len - k, j + 1) * C[len][k];
      ret %= 1000000007;
    }
  }
  return memo[len][j] = ret;
}
int main() {
  int N, K;
  make_nCr();
  while (cin >> N) {
    int tot = 0;
    for (int i = 0; i < 10; i++) {
      cin >> cnt[i];
      if (i != 0) tot += cnt[i];
    }
    memset(memo, -1, sizeof memo);
    int ans = 0;
    for (int i = 1; i <= N; i++) {
      ans += solve(i, 0);
      ans %= 1000000007;
    }
    cout << ans % 1000000007 << endl;
  }
  return 0;
}
