#include <bits/stdc++.h>
using namespace std;
int dcmp(long double n, long double y) {
  return fabs(n - y) <= 1e-9 ? 0 : n < y ? -1 : 1;
}
const int MAX1 = 2e2 + 10;
const int mod = 1e9 + 7;
int memo[MAX1][20], n, a[MAX1], fact[MAX1];
int Add(int x, int y) {
  int z = x + y;
  if (z >= mod) z -= mod;
  return z;
}
int Sub(int x, int y) {
  int z = x - y;
  if (z < 0) z += mod;
  return z;
}
int Mul(int x, int y) { return (x * 1ll * y) % mod; }
int powlog(int base, int power) {
  if (power == 0) return 1;
  int x = powlog(base, power / 2);
  x = Mul(x, x);
  if (power & 1) x = Mul(x, base);
  return x;
}
int modinv(int x) { return powlog(x, mod - 2); }
int Div(int x, int y) { return Mul(x, modinv(y)); }
int dp(int idx, int j) {
  if (idx < 0) return 0;
  if (j == 9) {
    if (a[9] > idx)
      return 0;
    else
      return 1;
  }
  int &ret = memo[idx][j];
  if (ret != -1) return ret;
  int path = 0;
  if (j == 0) {
    for (int i = a[j]; i < idx; i++)
      path =
          Add(path, Mul(dp(idx - i, j + 1),
                        Div(fact[idx - 1], Mul(fact[idx - 1 - i], fact[i]))));
  } else {
    for (int i = a[j]; i <= idx; i++)
      path = Add(path, Mul(dp(idx - i, j + 1),
                           Div(fact[idx], Mul(fact[idx - i], fact[i]))));
  }
  return ret = path;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  fact[0] = 1;
  for (int i = 1; i < MAX1; ++i) fact[i] = Mul(fact[i - 1], i);
  memset(memo, -1, sizeof(memo));
  cin >> n;
  for (int i = 0; i < (int)(10); ++i) {
    cin >> a[i];
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    ans = Add(ans, dp(i, 0));
  }
  cout << ans << '\n';
}
