#include <bits/stdc++.h>
using namespace std;
int nCr[105][105];
int atLeast[10];
int mem[105][10];
int n;
int dp(int len, int index) {
  if (index == 10) {
    return (len == 0);
  } else if (mem[len][index] != -1) {
    return mem[len][index];
  } else {
    long long res = 0;
    long long combination;
    for (int i = atLeast[index]; i <= len; i++) {
      if (index == 0) {
        combination = nCr[len - 1][i];
      } else {
        combination = nCr[len][i];
      }
      res = (res + combination * dp(len - i, index + 1)) % 1000000007;
    }
    return mem[len][index] = res;
  }
}
int main() {
  cin >> n;
  for (int i = 0; i < 10; i++) {
    cin >> atLeast[i];
  }
  for (int i = 0; i < 105; i++) {
    nCr[i][0] = nCr[i][i] = 1;
    for (int j = 1; j < i; j++) {
      nCr[i][j] = (nCr[i - 1][j] + nCr[i - 1][j - 1]) % 1000000007;
    }
  }
  for (int i = 0; i < 105; i++) {
    for (int j = 0; j < 10; j++) {
      mem[i][j] = -1;
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    ans = (ans + dp(i, 0)) % 1000000007;
  }
  cout << ans;
  return 0;
}
