#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
const int N = 3e5 + 5, OO = 1e9;
int n, dp[1000][20001][2], arr[1005];
int solve(int i = 0, int sum = 0, int f = 0) {
  if (i == n) return !sum && f;
  int &ret = dp[i][sum + 1000][f];
  if (~ret) return ret;
  ret = solve(i + 1, sum - arr[i], 1) + solve(i + 1, sum + arr[i], 1);
  if (ret >= 1000000007) ret -= 1000000007;
  if (f) {
    ret += !sum;
    if (ret >= 1000000007) ret -= 1000000007;
  } else {
    ret += solve(i + 1, sum, 0);
    if (ret >= 1000000007) ret -= 1000000007;
  }
  return ret;
}
int main() {
  memset(dp, -1, sizeof dp);
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", arr + i);
  printf("%d", solve());
  return 0;
}
