#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long b, long long mod) {
  long long c = 1;
  while (b > 0) {
    if (b % 2) c *= a, c %= mod;
    b /= 2;
    a *= a;
    a %= mod;
  }
  return c;
}
long long dp[11][101];
long long c[101][101];
long long a[11];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n;
  cin >> n;
  for (long long i = 0; i <= 100; i++) {
    c[i][0] = 1;
    for (long long j = 1; j <= i; j++) {
      c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % 1000000007;
    }
  }
  for (long long i = 0; i < 10; i++) cin >> a[i];
  dp[10][0] = 1;
  for (long long i = 9; i > 0; i--) {
    for (long long j = 0; j <= n; j++) {
      for (long long k = a[i]; k <= j; k++) {
        dp[i][j] = (dp[i][j] + dp[i + 1][j - k] * c[j][k]) % 1000000007;
      }
    }
  }
  long long ans = 0;
  for (long long j = a[0] + 1; j <= n; j++) {
    for (long long k = a[0]; k <= j; k++) {
      ans = (ans + dp[1][j - k] * c[j - 1][k]) % 1000000007;
    }
  }
  cout << ans;
}
