#include <bits/stdc++.h>
const int N = 20005;
const int inf = 1 << 28;
const int mod = 1e9 + 7;
const int zero = 10000;
const double eps = 1e-8;
using namespace std;
int n, a[1005], sum[1005];
int dp[2][N];
int main() {
  while (scanf("%d", &n) > 0) {
    sum[0] = 0;
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      sum[i] = sum[i - 1] + a[i];
    }
    memset(dp, 0, sizeof(dp));
    int res = 0;
    for (int i = 1; i <= n; i++) {
      int u = i & 1;
      for (int j = -sum[i]; j <= sum[i]; j++) {
        dp[u][j + zero] =
            (dp[u ^ 1][j - a[i] + zero] + dp[u ^ 1][j + a[i] + zero]) % mod;
      }
      res += dp[u][zero], res %= mod;
      dp[u][a[i] + zero]++, dp[u][-a[i] + zero]++;
      dp[u][a[i] + zero] %= mod, dp[u][-a[i] + zero] %= mod;
    }
    printf("%d\n", res);
  }
  return 0;
}
