#include <bits/stdc++.h>
using namespace std;
const int N = 210;
const int B = 1e9 + 7;
int n;
int ans;
int a[10];
long long c[N][N];
long long f[10][N];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < 10; ++i) {
    scanf("%d", a + i);
  }
  for (int i = 0; i <= n; ++i) {
    c[i][0] = 1;
    for (int j = 1; j <= i; ++j) {
      c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % B;
    }
  }
  for (int i = a[9]; i <= n; ++i) f[9][i] = 1;
  for (int i = 8; i >= 1; --i) {
    for (int j = a[i]; j <= n; ++j) {
      for (int k = a[i]; k <= j; ++k) {
        f[i][j] = (f[i][j] + c[j][k] * f[i + 1][j - k]) % B;
      }
    }
  }
  for (int j = a[0]; j <= n; ++j) {
    for (int k = a[0]; k <= j - 1; ++k) {
      ans = (ans + c[j - 1][k] * f[1][j - k]) % B;
    }
  }
  printf("%d\n", ans);
  return 0;
}
