#include <bits/stdc++.h>
using namespace std;
const int MAX = 100 + 10;
const long long DELTA = 1000 * 1000 * 1000 + 7;
int number[10];
int n;
long long ans[10][MAX][MAX];
long long d[MAX][MAX];
long long ans_h[10][MAX];
long long sum;
void input() {
  cin >> n;
  for (int i = 0; i < 10; i = i + 1) {
    cin >> number[i];
  }
}
void make_d() {
  for (int i = 0; i < MAX; i = i + 1) {
    d[i][0] = 1;
  }
  for (int i = 1; i < MAX; i = i + 1) {
    for (int j = 1; j <= i; j = j + 1) {
      d[i][j] = (d[i - 1][j - 1] + d[i - 1][j]) % DELTA;
    }
  }
}
void make_ans_h(int x) {
  for (int i = number[x]; i <= n; i = i + 1) {
    for (int j = number[x]; j <= i; j = j + 1) {
      ans_h[x][i] = (ans_h[x][i] + ans[x][i][j]) % DELTA;
    }
  }
}
void make_ans() {
  for (int i = number[9]; i <= n; i = i + 1) {
    ans_h[9][i] = 1;
  }
  for (int i = 8; i > 0; i = i - 1) {
    for (int j = number[i]; j <= n; j = j + 1) {
      for (int k = number[i]; k <= j; k = k + 1) {
        ans[i][j][k] = (ans_h[i + 1][j - k] * d[j][j - k]) % DELTA;
      }
    }
    make_ans_h(i);
  }
  for (int i = number[0]; i <= n; i = i + 1) {
    for (int j = number[0]; j <= i; j = j + 1) {
      ans[0][i][j] = (ans_h[1][i - j] * d[i - 1][i - j - 1]) % DELTA;
    }
  }
  make_ans_h(0);
}
void output() {
  for (int i = 0; i <= n; i = i + 1) {
    sum = sum + ans_h[0][i];
    sum = sum % DELTA;
  }
  cout << sum << endl;
}
int main() {
  input();
  make_d();
  make_ans();
  output();
  return 0;
}
