#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000 + 10;
const int maxs = 20000 + 10;
const int mod = 1000000007;
int N, sum;
int a[maxn];
int dp[maxn][maxs];
int main() {
  while (scanf("%d", &N) == 1) {
    memset(dp, 0, sizeof(dp));
    sum = 0;
    for (int i = 1; i <= N; ++i) {
      scanf("%d", &a[i]);
      sum += a[i];
    }
    for (int i = 0; i <= N; ++i) {
      dp[i][sum] = 1;
    }
    for (int i = 1; i <= N; ++i)
      for (int s = 0; s <= sum * 2; ++s) {
        int tmp = s + a[i];
        if (tmp <= 2 * sum) dp[i][tmp] = (dp[i][tmp] + dp[i - 1][s]) % mod;
        tmp = s - a[i];
        if (tmp >= 0) dp[i][tmp] = (dp[i][tmp] + dp[i - 1][s]) % mod;
      }
    int ans = 0;
    for (int i = 1; i <= N; ++i) {
      ans = ans + dp[i][sum] - 1;
      if (ans < 0)
        ans += mod;
      else
        ans %= mod;
    }
    printf("%d\n", ans);
  }
}
