#include <bits/stdc++.h>
using namespace std;
unsigned long long MOD = 1e9 + 7;
unsigned long long C[1000][1000] = {};
void make() {
  for (int i = 0; i < 1000; ++i) C[i][0] = 1;
  for (int i = 1; i < 1000; ++i) {
    for (int j = 1; j <= i; ++j)
      C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % MOD;
  }
}
int main() {
  make();
  int n, a[10] = {};
  cin >> n;
  for (int i = 0; i < 10; ++i) cin >> a[i];
  unsigned long long dp[105][10] = {};
  for (int l = 0; l <= n; ++l) {
    for (int j = 9; j >= 0; --j) {
      if (j == 0) {
        for (int i = a[0]; i <= l; ++i)
          if (l != 0)
            dp[l][j] = (dp[l][j] + (dp[l - i][1] * C[l - 1][i])) % MOD;
      }
      if (j == 9) {
        if (l < a[9])
          dp[l][j] = 0;
        else
          dp[l][j] = 1;
      }
      if (j > 0 && j < 9) {
        for (int i = a[j]; i <= l; ++i)
          dp[l][j] = (dp[l][j] + (dp[l - i][j + 1] * C[l][i])) % MOD;
      }
    }
  }
  unsigned long long ans = 0;
  for (int i = 0; i <= n; ++i) ans = (ans + dp[i][0]) % MOD;
  cout << ans;
  return 0;
}
