#include <bits/stdc++.h>
using namespace std;
unsigned long long PT[103][103 + 1];
void build_pascal_triangle() {
  PT[0][0] = 1;
  for (int n = 1; n < 103; ++n) {
    PT[n][0] = 1;
    for (int k = 1; k < n; ++k) {
      PT[n][k] = (PT[n - 1][k - 1] + PT[n - 1][k]) % 1000000007;
    }
    PT[n][n] = 1;
  }
}
unsigned long long Choose(int n, int k) {
  if (n < 0 || k < 0 || k > n) return 0;
  return PT[n][k];
}
int D[10];
int memo[104][10];
int go(int len, int start_dig = 0) {
  if (len < 0) return 0;
  if (start_dig == 9) return len >= D[9] ? 1 : 0;
  int& res = memo[len][start_dig];
  if (res < 0) {
    res = 0;
    int llen = start_dig == 0 ? len - 1 : len;
    for (int k = D[start_dig]; k <= len; ++k)
      res = (res + go(len - k, start_dig + 1) * Choose(llen, k)) % 1000000007;
  }
  return res;
}
int main(int argc, char* argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  build_pascal_triangle();
  int num_len;
  cin >> num_len;
  for (int j = 0; j < 10; ++j) cin >> D[j];
  unsigned long long res = 0;
  for (int len = accumulate(D, D + 10, 0); len <= num_len; ++len) {
    memset(memo, -1, sizeof(memo));
    int cur = go(len);
    res = (res + cur) % 1000000007;
  }
  cout << res << endl;
  return 0;
}
