#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000 * 1000 * 1000 + 7;
const int N = 10007;
int dp[1001][N + N];
int a[N];
int cl[N + N + N];
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> v;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    dp[i][a[i] + N]++;
    dp[i][-a[i] + N]++;
    if (!cl[a[i] + N]) {
      cl[a[i] + N] = true;
      v.push_back(a[i]);
    }
    if (!cl[-a[i] + N]) {
      cl[-a[i] + N] = true;
      v.push_back(-a[i]);
    }
  }
  long long ans = 0;
  for (int i = 2; i <= n; i++) {
    for (int j = 0; j < v.size(); j++) {
      int k = v[j];
      if (dp[i - 1][k + N] == 0) continue;
      if (!cl[k + a[i] + N]) {
        cl[k + a[i] + N] = true;
        v.push_back(k + a[i]);
      }
      if (!cl[k - a[i] + N]) {
        cl[k - a[i] + N] = true;
        v.push_back(k - a[i]);
      }
      dp[i][k + a[i] + N] += dp[i - 1][k + N];
      dp[i][k - a[i] + N] += dp[i - 1][k + N];
      dp[i][k + a[i] + N] %= MOD;
      dp[i][k - a[i] + N] %= MOD;
    }
    ans += dp[i][N];
    ans %= MOD;
  }
  cout << ans << endl;
  return 0;
}
