#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
template <typename T>
void printV(vector<T>& v) {
  for (int i = 0; i < (int)(v.size()); i++) cout << v[i] << " ";
  cout << endl;
}
template <typename T>
void printVs(vector<vector<T> >& v) {
  for (int i = 0; i < (int)(v.size()); i++) printV(v[i]);
}
template <typename T>
void printVs(T** v, int H, int W) {
  for (int i = 0; i < (int)(H); i++) {
    for (int j = 0; j < (int)(W); j++) cout << v[i][j] << " ";
    cout << endl;
  }
}
void printV(vector<pair<int, int> >& v) {
  for (int i = 0; i < (int)(v.size()); i++)
    cout << "(" << v[i].first << "," << v[i].second << ") ";
}
void err() { cout << "wtf " << endl; }
int n;
int a[10];
long long A[101][11];
int main() {
  cin >> n;
  for (int i = 0; i < (int)(10); i++) cin >> (a[i]);
  memset(A, 0, sizeof(A));
  long long binom[101][101];
  for (int i = 0; i < (int)(101); i++)
    for (int j = 0; j < (int)(101); j++) {
      if (i * j == 0) {
        binom[i][j] = 1;
        continue;
      }
      binom[i][j] = binom[i - 1][j] + binom[i][j - 1];
      binom[i][j] %= mod;
    }
  A[0][10] = 1;
  for (int pos = 9; pos >= 0; pos--)
    for (int len = 0; len < (int)(n + 1); len++) {
      int need = 0;
      for (int i = (pos); i < (int)(10); i++) need += a[i];
      if (need > len) continue;
      if (len == 0) {
        A[len][pos] = 1;
        continue;
      }
      long long ans = 0;
      for (int numCur = (a[pos]); numCur < (int)(len + (pos != 0)); numCur++) {
        ans +=
            A[len - numCur][pos + 1] * binom[numCur][len - numCur - (pos == 0)];
        ans %= mod;
      }
      A[len][pos] = ans;
    }
  long long res = 0;
  for (int len = (1); len < (int)(n + 1); len++) {
    res += A[len][0];
    res %= mod;
  }
  cout << res << endl;
}
