#include <bits/stdc++.h>
using namespace std;
template <typename T>
using vc = vector<T>;
using pii = pair<long long, long long>;
void xmax(long long& a, long long b) { a = max(a, b); }
void xmin(long long& a, long long b) { a = min(a, b); }
void print(vc<long long>& a, string second) {
  cerr << second << " : ";
  for (long long i = 0; i < a.size(); i++) {
    cerr << a[i] << " ";
  }
  cerr << endl;
}
long long max_val = 10001;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  cerr << "case" << endl;
  vc<long long> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long mod = 1e9 + 7;
  vc<vc<long long> > dp(n + 1, vc<long long>(2 * max_val));
  long long anz = 0;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < 2 * max_val; j++) {
      dp[i][j] = dp[i][j] % mod;
      if (dp[i][j] == 0) continue;
      dp[i + 1][j + a[i]] = (dp[i][j] + dp[i + 1][j + a[i]]) % mod;
      dp[i + 1][j - a[i]] = (dp[i][j] + dp[i + 1][j - a[i]]) % mod;
      if (j + a[i] == max_val) anz += dp[i][j];
      if (j - a[i] == max_val) anz += dp[i][j];
      anz = anz % mod;
    }
    dp[i + 1][max_val + a[i]] += 1;
    dp[i + 1][max_val - a[i]] += 1;
  }
  cout << anz << "\n";
}
