#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
const int MX = 20004;
const int MOD = 1e9 + 7;
const int Z = MX / 2;
int dp[N][MX][2];
int v[N];
int n;
int f(int x) {
  if (x >= MOD) return x - MOD;
  return x;
}
int solve(int idx = 0, int sum = Z, int start = 0) {
  if (idx == n) return 0;
  int &ret = dp[idx][sum][start];
  if (~ret) return ret;
  if (start) {
    return ret = f(solve(idx + 1, sum + v[idx], start) +
                   solve(idx + 1, sum - v[idx], start) + (sum + v[idx] == Z) +
                   (sum - v[idx] == Z));
  }
  return ret =
             f(solve(idx + 1, sum, start) + f(solve(idx + 1, sum + v[idx], 1) +
                                              solve(idx + 1, sum - v[idx], 1)));
}
int main() {
  memset(dp, -1, sizeof dp);
  scanf("%d", &n);
  for (int i = 0; i < int(n); i++) scanf("%d", &v[i]);
  printf("%d\n", solve());
  return 0;
}
