#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e3 + 100;
const long long mod = 1e9 + 7;
const long long base = 1e4 + 2000;
long long dp[maxn][25 * maxn];
long long a[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  if (fopen("DREAM.INP", "r")) {
    freopen("DREAM.INP", "r", stdin);
    freopen("DREAM.OUT", "w", stdout);
  }
  dp[0][base] = 1;
  long long n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = -10000; j <= 10000; j++) {
      long long x = a[i];
      dp[i][j + base] =
          (dp[i - 1][j - x + base] + dp[i - 1][j + x + base]) % mod;
    }
    ans += dp[i][base];
    dp[i][base]++;
    dp[i][base] %= mod;
    ans %= mod;
  }
  cout << ans;
}
