#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
long long add(long long x, long long y, long long CMOD = MOD) {
  return (2 * CMOD + x + y) % CMOD;
}
long long mult(long long x, long long y, long long CMOD = MOD) {
  return add(x, 0) * add(y, 0) % CMOD;
}
long long fast_expo(long long x, long long y, long long CMOD = MOD) {
  if (x == 0) return 0;
  if (y == 0) return 1;
  long long ans = fast_expo(x, y / 2, CMOD);
  ans = mult(ans, ans, CMOD);
  if (y & 1) ans = mult(ans, x, CMOD);
  return ans;
}
const int TAM = 1005;
const long long INF = LLONG_MAX / 4;
int n;
int a[TAM];
int b[TAM];
bool vis[15][TAM];
long long memo[15][TAM];
long long f[TAM];
long long first[TAM];
void pre() {
  f[0] = 1;
  for (int i = 1; i < TAM; i++) f[i] = mult(i, f[i - 1]);
  for (int i = 0; i < TAM; i++) first[i] = fast_expo(f[i], MOD - 2);
}
long long comb(int x, int y) {
  return mult(f[x], mult(first[y], first[x - y]));
}
long long dp(int pos, int libres) {
  if (pos == 9) return (libres >= b[9]);
  if (vis[pos][libres]) return memo[pos][libres];
  vis[pos][libres] = true;
  long long ans = 0;
  for (int t = b[pos]; t <= libres; t++) {
    ans = add(ans, mult(comb(libres, t), dp(pos + 1, libres - t)));
  }
  return memo[pos][libres] = ans;
}
int main() {
  pre();
  int m = 10;
  cin >> n;
  int mi = 0;
  for (int i = 0; i < m; i++) cin >> a[i], mi += a[i];
  long long ans = 0;
  for (int i = 1; i < m; i++) {
    for (int j = 0; j < m; j++) b[j] = a[j];
    int nt = n - 1;
    if (a[i] != 0) b[i]--;
    memset(vis, false, sizeof vis);
    for (int t = mi - 1; t <= nt; t++) {
      ans = add(ans, dp(0, t));
    }
    for (int t = mi - 1; false; t++) {
      for (int k = 0; k < 10; k++) {
        cerr << "k"
             << " = " << k << "\t";
        {
          cerr << "t"
               << " = " << t << "\t";
          cerr << "dp(k, t)"
               << " = " << dp(k, t) << endl;
        };
      };
    }
  }
  cout << ans << endl;
  return 0;
}
