#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const int base = 10000;
int n, A[1005];
long long sum[1005][20005];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", A + i);
  sum[0][base] = 1;
  int mx = 0;
  for (int i = 1; i <= n; i++) {
    if (i > 1) {
      sum[i][base + A[i]] = sum[i][base - A[i]] = 1;
    }
    for (int j = -mx; j <= mx; j++)
      if (sum[i - 1][j + base]) {
        sum[i][j + base + A[i]] += sum[i - 1][j + base];
        if (sum[i][j + base + A[i]] >= MOD) sum[i][j + base + A[i]] -= MOD;
        sum[i][j + base - A[i]] += sum[i - 1][j + base];
        if (sum[i][j + base - A[i]] >= MOD) sum[i][j + base - A[i]] -= MOD;
      }
    mx += A[i];
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    ans += sum[i][base];
    if (ans >= MOD) ans -= MOD;
  }
  printf("%lld\n", ans);
  return 0;
}
