#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
const long long linf = (long long)1e18;
const int mod = (int)1e9 + 7;
const long double eps = (long double)1e-8;
const int maxn = (int)1e5 + 5;
const long double pi = acos(-1);
const int N = 10;
long long ans;
int n;
long long d[12][222];
long long f[222], of[222];
long long a[12];
long long my_pow(long long x, long long y) {
  if (y == 0) return 1;
  if (y & 1)
    return x * my_pow(x, y - 1) % mod;
  else {
    x = my_pow(x, y / 2);
    return x * x % mod;
  }
}
long long cnk(long long n, long long k) {
  if (k < 0 || k > n || n < 0) return 0;
  return f[n] * of[n - k] % mod * of[k] % mod;
}
void check(int n) {
  memset((d), 0, sizeof(d));
  d[0][0] = 1;
  for (auto i = 0; i < N; ++i) {
    for (auto j = 0; j < n + 1; ++j) {
      for (auto k = max((long long)0, a[i]); k < n + 1; ++k) {
        if (d[i][j] == 0) continue;
        d[i + 1][j + k] += (long long)cnk(n - j, k) * d[i][j];
        d[i + 1][j + k] %= mod;
      }
    }
  }
  ans += d[N][n];
  ans %= mod;
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  f[0] = 1;
  of[0] = 1;
  for (auto i = 1; i < 222; ++i) {
    f[i] = f[i - 1] * (long long)i % mod;
    of[i] = my_pow(f[i], mod - 2);
  }
  long long s = 0;
  cin >> n;
  for (auto i = 0; i < N; ++i) {
    cin >> a[i];
    s += a[i];
  }
  ans = 0;
  for (auto i = 1; i < n + 1; ++i)
    for (auto j = 1; j < N; ++j) {
      --a[j];
      check(i - 1);
      ++a[j];
    }
  cout << ans << endl;
  return 0;
}
