#include <bits/stdc++.h>
using namespace std;
const int SIZE = 100 + 10;
const long long mod = 1e9 + 7;
long long C[SIZE][SIZE];
long long dp[10][SIZE];
long long a[SIZE];
int n;
int main() {
  cin >> n;
  for (int i = 0; i < 10; ++i) cin >> a[i];
  int D = 8;
  C[1][1] = 1;
  for (int i = 0; i <= n; ++i) C[i][0] = 1;
  for (int i = 2; i <= n; ++i) {
    for (int j = 1; j <= i; ++j)
      C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % mod;
  }
  for (int j = a[9]; j <= n; ++j) dp[9][j] = 1;
  for (int dig = 8; dig >= 0; --dig) {
    for (int delta = a[dig]; delta <= n; ++delta) {
      for (int len = 0; len + delta <= n; ++len) {
        long long &ref = dp[dig][len + delta];
        if (dig)
          ref = (ref + (C[len + delta][delta] * dp[dig + 1][len]) % mod) % mod;
        else
          ref = (ref + (C[len + delta - 1][delta] * dp[dig + 1][len]) % mod) %
                mod;
      }
    }
  }
  long long res = 0;
  for (int len = 1; len <= n; ++len) res = (res + dp[0][len]) % mod;
  cout << res;
  return 0;
}
