#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000 * 1000 * 1000 + 7;
const int INF = 2000 * 1000 * 1000;
const double EPS = 1e-9;
const double pi = acos(-1.0);
const int maxn = 1010;
const int maxsum = 10010;
const long long lim = (int)1e13;
template <typename T>
inline T sqr(T n) {
  return (n * n);
}
int n, a[maxn], mem[maxn][2 * maxsum];
int* dp[maxn];
long long ans;
int read_int() {
  char c;
  do {
    c = getc(stdin);
  } while (c < '0' || c > '9');
  int res = 0;
  do {
    res = res * 10 + c - '0';
    c = getc(stdin);
  } while (c >= '0' && c <= '9');
  return res;
}
int main() {
  n = read_int();
  dp[0] = mem[0] + maxsum;
  for (int i = 1; i <= n; i++) {
    a[i] = read_int();
    dp[i] = mem[i] + maxsum;
  }
  dp[0][0] = 1;
  ans = 0;
  for (int i = 1; i <= n; i++) {
    for (int sum = -10000; sum <= 10000; sum++) {
      if (sum + a[i] <= 10000) dp[i][sum] += dp[i - 1][sum + a[i]];
      if (sum - a[i] >= -10000) dp[i][sum] += dp[i - 1][sum - a[i]];
      dp[i][sum] %= MOD;
    }
    ans += dp[i][0];
    if (ans > lim) ans %= MOD;
    dp[i][0]++;
  }
  printf("%I64d", ans % MOD);
  return 0;
}
