#include <bits/stdc++.h>
using namespace std;
const int N = 1005 + 10;
long long mod = 1e9 + 7;
int offset = 1e4;
long long dp[N][20009];
int a[N];
int n;
long long calc(int i, int sum) {
  if (i >= n) return !sum;
  long long &res = dp[i][sum + offset];
  if (res != -1) return res;
  res = !sum;
  long long r1 = calc(i + 1, sum - a[i]);
  long long r2 = calc(i + 1, sum + a[i]);
  res += (r1 + r2) % mod;
  res %= mod;
  return res;
}
int main() {
  memset(dp, -1, sizeof dp);
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    long long cur = calc(i, 0) - 1 + mod;
    cur %= mod;
    ans = (ans + cur) % mod;
  }
  printf("%I64d\n", ans);
  return 0;
}
