#include <bits/stdc++.h>
using namespace std;
template <typename T>
T gcd(T a, T b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
template <typename T>
T pow(T a, T b, long long m) {
  T ans = 1;
  while (b > 0) {
    if (b % 2 == 1) ans = ((ans % m) * (a % m)) % m;
    b /= 2;
    a = ((a % m) * (a % m)) % m;
  }
  return ans % m;
}
long long a[10];
long long fac[202];
void factorial() {
  fac[0] = 1;
  for (int i = 1; i < 200; i++) {
    fac[i] = fac[i - 1] * i;
    fac[i] %= (long long)(1000 * 1000 * 1000 + 7);
  }
}
long long c(long long n, long long k) {
  long long nemo = fac[n];
  long long deno = fac[k] * fac[n - k];
  deno %= (long long)(1000 * 1000 * 1000 + 7);
  long long invdeno = pow(deno, (long long)(1000 * 1000 * 1000 + 7) - 2,
                          (long long)(1000 * 1000 * 1000 + 7));
  long long pro = nemo * invdeno;
  pro %= (long long)(1000 * 1000 * 1000 + 7);
  return pro;
}
long long dp[105][10];
long long solve(int len, int curnum) {
  if (len < 0) return 0;
  if (curnum == 9) {
    return len >= a[9];
  }
  long long ans = 0;
  if (dp[len][curnum] != -1) return dp[len][curnum];
  if (curnum == 0) {
    for (int i = a[curnum]; i < len; i++) {
      ans += solve(len - i, curnum + 1) * c(len - 1, i);
      ans %= (long long)(1000 * 1000 * 1000 + 7);
    }
  } else {
    for (int i = a[curnum]; i <= len; i++) {
      ans += solve(len - i, curnum + 1) * c(len, i);
      ans %= (long long)(1000 * 1000 * 1000 + 7);
    }
  }
  return dp[len][curnum] = (ans % (long long)(1000 * 1000 * 1000 + 7));
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  factorial();
  for (int i = 0; i < 10; i++) cin >> a[i];
  long long ans = 0;
  for (int i = 0; i <= n; i++) {
    if (i >= a[9])
      dp[i][9] = 1;
    else
      dp[i][9] = 0;
  }
  for (int k = 0; k <= n; k++) {
    for (int j = 8; j >= 0; j--) {
      if (j != 0) {
        for (int l = a[j]; l <= k; l++) {
          dp[k][j] += dp[k - l][j + 1] * c(k, l);
          dp[k][j] %= (long long)(1000 * 1000 * 1000 + 7);
        }
      } else {
        for (int l = a[j]; l <= k; l++) {
          dp[k][j] += dp[k - l][j + 1] * c(k - 1, l);
          dp[k][j] %= (long long)(1000 * 1000 * 1000 + 7);
        }
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    ans += dp[i][0];
    ans %= (long long)(1000 * 1000 * 1000 + 7);
  }
  cout << ans;
}
