#include <bits/stdc++.h>
using namespace std;
struct num {
  static constexpr int mod = 1000000007;
  int v;
  using ll = long long;
  static int inv(int a, int m) {
    a %= m;
    return a == 1 ? 1 : (int)(m - ll(inv(m, a)) * ll(m) / a);
  }
  num() : v(0) {}
  num(ll v_) : v(int(v_ % mod)) {
    if (v < 0) v += mod;
  }
  explicit operator int() const { return v; }
  friend std::ostream& operator<<(std::ostream& out, const num& n) {
    return out << int(n);
  }
  friend std::istream& operator>>(std::istream& in, num& n) {
    ll v_;
    in >> v_;
    n = num(v_);
    return in;
  }
  friend bool operator==(const num& a, const num& b) { return a.v == b.v; }
  friend bool operator!=(const num& a, const num& b) { return a.v != b.v; }
  num inv() const {
    num res;
    res.v = inv(v, mod);
    return res;
  }
  num operator-() const {
    num res;
    res.v = v ? mod - v : 0;
    return res;
  }
  num operator+() const { return num(*this); }
  num& operator++() {
    v++;
    if (v == mod) v = 0;
    return *this;
  }
  num& operator--() {
    if (v == 0) v = mod;
    v--;
    return *this;
  }
  num& operator+=(const num& o) {
    v += o.v;
    if (v >= mod) v -= mod;
    return *this;
  }
  num& operator-=(const num& o) {
    v -= o.v;
    if (v < 0) v += mod;
    return *this;
  }
  num& operator*=(const num& o) {
    v = int(ll(v) * ll(o.v) % mod);
    return *this;
  }
  num& operator/=(const num& o) { return *this *= o.inv(); }
  friend num operator++(num& a, int) {
    num r = a;
    ++a;
    return r;
  }
  friend num operator--(num& a, int) {
    num r = a;
    --a;
    return r;
  }
  friend num operator+(const num& a, const num& b) { return num(a) += b; }
  friend num operator-(const num& a, const num& b) { return num(a) -= b; }
  friend num operator*(const num& a, const num& b) { return num(a) *= b; }
  friend num operator/(const num& a, const num& b) { return num(a) /= b; }
  friend bool operator<(const num& a, const num& b) { return a.v < b.v; }
  friend bool operator<=(const num& a, const num& b) { return a.v <= b.v; }
  friend bool operator>(const num& a, const num& b) { return a.v > b.v; }
  friend bool operator>=(const num& a, const num& b) { return a.v >= b.v; }
};
namespace minmax {
template <class T>
T max(T&& A) {
  return A;
}
template <class T>
T min(T&& A) {
  return A;
}
template <class T>
T max(T&& A, T&& B) {
  return A > B ? A : B;
}
template <class T>
T min(T&& A, T&& B) {
  return A < B ? A : B;
}
template <class T, class... Ts>
T max(T&& A, Ts&&... ts) {
  T B = max(ts...);
  return A > B ? A : B;
}
template <class T, class... Ts>
T min(T&& A, Ts&&... ts) {
  T B = min(ts...);
  return A < B ? A : B;
}
template <class T, class... Ts>
T chmax(T&& A, Ts&&... ts) {
  A = max(A, ts...);
  return A;
}
template <class T, class... Ts>
T chmin(T&& A, Ts&&... ts) {
  A = min(A, ts...);
  return A;
}
}  // namespace minmax
namespace input {
template <class T>
void re(T&& Xx) {
  cin >> Xx;
}
template <class T1, class T2>
void re(pair<T1, T2>& Pp) {
  re(Pp.first);
  re(Pp.second);
}
template <class T>
void re(vector<T>& Aa) {
  for (int i = 0; i < (int)(Aa).size(); i++) re(Aa[i]);
}
template <class T1, class T2>
void rea(T1&& Aa, T2 t) {
  for (int i = 0; i < t; i++) re(Aa[i]);
}
template <class T1, class T2, class... Ts>
void rea(T1&& Aa, T2 t, Ts&&... ts) {
  rea(Aa, t);
  rea(ts...);
}
template <class T1, class T2>
void rea1(T1&& Aa, T2 t) {
  for (int i = 1; i <= t; i++) re(Aa[i]);
}
template <class T1, class T2, class... Ts>
void rea1(T1&& Aa, T2 t, Ts&... ts) {
  rea1(Aa, t);
  rea1(ts...);
}
template <class T, class... Ts>
void re(T&& t, Ts&... ts) {
  re(t);
  re(ts...);
}
}  // namespace input
namespace output {
void pr(int Xx) { cout << Xx; }
void pr(num Xx) { cout << Xx; }
void pr(bool Xx) { cout << Xx; }
void pr(long long Xx) { cout << Xx; }
void pr(long long unsigned Xx) { cout << Xx; }
void pr(double Xx) { cout << Xx; }
void pr(char Xx) { cout << Xx; }
void pr(const string& Xx) { cout << Xx; }
void pr(const char* Xx) { cout << Xx; }
void pr(const char* Xx, size_t len) { cout << string(Xx, len); }
void ps() { cout << "\n"; }
void pn() {}
void pw() { pr(" "); }
void pc() {
  pr("]");
  ps();
}
template <class T1, class T2>
void pr(const pair<T1, T2>& Xx) {
  pr(Xx.first);
  pw();
  pr(Xx.second);
}
template <class T>
void pr(const T&);
bool parse(const char* t) {
  if (t == "\n") return true;
  return false;
}
template <class T>
bool parse(T&& t) {
  return false;
}
template <class T1, class T2>
bool parsepair(const pair<T1, T2>& Xx) {
  return true;
}
template <class T>
bool parsepair(T&& t) {
  return false;
}
template <class T1, class T2>
void psa(T1&& Aa, T2 t) {
  for (int i = 0; i < t; i++) pr(Aa[i]), pw();
  ps();
}
template <class T1, class T2>
void pna(T1&& Aa, T2 t) {
  for (int i = 0; i < t; i++) pr(Aa[i]), ps();
}
template <class T1, class T2>
void psa2(T1&& Aa, T2 t1, T2 t2) {
  for (int i = 0; i < t1; i++) {
    for (int j = 0; j < t2; j++) pr(Aa[i][j]), pw();
    ps();
  }
}
template <class T>
void pr(const T& Xx) {
  if (!(int)(Xx).size()) return;
  bool fst = 1;
  bool op = 0;
  if (parsepair(*Xx.begin())) op = 1;
  for (const auto& Aa : Xx) {
    if (!fst) pw();
    if (op) pr("{");
    pr(Aa), fst = 0;
    if (op) pr("}");
  }
}
template <class T, class... Ts>
void pr(const T& t, const Ts&... ts) {
  pr(t);
  pr(ts...);
}
template <class T, class... Ts>
void ps(const T& t, const Ts&... ts) {
  pr(t);
  if (sizeof...(ts)) {
    if (!parse(t)) pw();
  }
  ps(ts...);
}
template <class T>
void pn(const T& t) {
  for (const auto& Aa : t) ps(Aa);
}
template <class T, class... Ts>
void pw(const T& t, const Ts&... ts) {
  pr(t);
  if (sizeof...(ts)) pw();
  pw(ts...);
}
template <class T, class... Ts>
void pc(const T& t, const Ts&... ts) {
  bool op = 0;
  if (parsepair(t)) op = 1;
  if (op) pr("{");
  pr(t);
  if (op) pr("}");
  if (sizeof...(ts)) pr(", ");
  pc(ts...);
}
namespace trace {
template <class T1, class T2>
void __f(const char* name, const T1& Xx, const T2& y) {
  pr("[", y, "] = ");
  ps(Xx);
}
template <class T1, class T2, class... Ts>
void __f(const char* name, const T1& Xx, const T2& y, const Ts&... rest) {
  const char* open = strchr(name, '[');
  pr("[", y, "]");
  __f(open + 1, Xx, rest...);
}
template <class T1, class T2, class... Ts>
void __f0(const char* name, const T1& Xx, const T2& y, const Ts&... rest) {
  const char* open = strchr(name, '[');
  pr(name, size_t(open - name));
  __f(name, Xx, y, rest...);
}
template <class T>
void __fn(int n, const char* name, const T& Xx) {
  for (int i = 0; i < n; i++) pr(name), __f(name, Xx[i], i);
}
}  // namespace trace
}  // namespace output
using namespace minmax;
using namespace input;
using namespace output;
using namespace output::trace;
using ll = long long;
using pii = pair<int, int>;
const int N = 100 + 5;
int cnt[10];
num fact[N], factinv[N], inv[N], dp[11][N];
num nCr(int n, int r) {
  if (r > n) return num(0);
  num ans = fact[n] * factinv[r] * factinv[n - r];
  return ans;
}
void preprocess(int n) {
  fact[0] = factinv[0] = 1;
  fact[1] = factinv[1] = inv[1] = 1;
  for (int i = 2; i <= n; i++) {
    fact[i] = fact[i - 1] * num(i);
    inv[i] = num(-1000000007 / i) * inv[1000000007 % i];
    factinv[i] = factinv[i - 1] * inv[i];
  }
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int i, n, sum = 0;
  re(n);
  rea(cnt, 10);
  for (i = 0; i < 10; i++) sum += cnt[i];
  preprocess(N);
  num ans;
  dp[10][0] = 1;
  for (int dig = 9; ~dig; dig--)
    for (int len = 0; len <= n; len++)
      for (int take = cnt[dig]; take <= len; take++)
        dp[dig][len] += nCr(len - !dig, take) * dp[dig + 1][len - take];
  for (i = 1; i <= n; i++) ans += dp[0][i];
  ps(ans);
  return 0;
}
