#include <bits/stdc++.h>
using namespace std;
long long binomial[102][102];
int a[11];
long long dp[102][12];
long long solve(int numdigs, int pos) {
  if (numdigs < 0) return 0;
  if (pos == 10) {
    if (numdigs == 0)
      return 1;
    else
      return 0;
  }
  if (dp[numdigs][pos] != -1) return dp[numdigs][pos];
  long long answer = 0;
  for (int j = max(0, a[pos]); j <= numdigs; j++) {
    answer = (answer + binomial[numdigs][j] * solve(numdigs - j, pos + 1)) %
             1000000007;
  }
  return dp[numdigs][pos] = answer;
}
int main() {
  for (int i = 0; i < 102; i++)
    for (int j = 0; j <= i; j++) {
      if (j == 0)
        binomial[i][j] = 1;
      else
        binomial[i][j] =
            (binomial[i - 1][j] + binomial[i - 1][j - 1]) % 1000000007;
    }
  int n;
  scanf("%d", &n);
  for (int i = 0; i <= 9; i++) scanf("%d", &a[i]);
  long long answer = 0;
  for (int firstdig = 1; firstdig <= 9; firstdig++) {
    a[firstdig]--;
    for (int nd = 0; nd <= n + 1; nd++)
      for (int j = 0; j <= 10; j++) dp[nd][j] = -1;
    for (int d = 0; d <= n - 1; d++) {
      answer = (answer + solve(d, 0)) % 1000000007;
    }
    a[firstdig]++;
  }
  cout << answer << endl;
}
