#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int n;
int d[10];
long long dp[105];
long long odp[105];
long long c[105][105];
int main() {
  cin >> n;
  for (int i = 0; i < 10; ++i) cin >> d[i];
  c[0][0] = 1;
  for (int a = 1; a <= 100; ++a)
    for (int b = 0; b <= 100; ++b) {
      if (b == 0)
        c[a][b] = 1;
      else
        c[a][b] = (c[a - 1][b] + c[a - 1][b - 1]) % MOD;
    }
  memset(odp, 0, sizeof(odp));
  odp[0] = 1;
  for (int tdig = 1; tdig <= 10; ++tdig) {
    int dig = tdig % 10;
    memset(dp, 0, sizeof(dp));
    for (int len = 0; len <= n; ++len) {
      for (int cnt = d[dig]; cnt + len <= n; ++cnt) {
        if (dig == 0) {
          dp[len + cnt] += odp[len] * c[len + cnt - 1][cnt];
          dp[len + cnt] %= MOD;
        } else {
          dp[len + cnt] += odp[len] * c[len + cnt][cnt];
          dp[len + cnt] %= MOD;
        }
      }
    }
    for (int i = 0; i <= n; ++i) odp[i] = dp[i];
  }
  int res = 0;
  for (int i = 1; i <= n; ++i) {
    res += dp[i];
    res %= MOD;
  }
  cout << res << endl;
  return 0;
}
