#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
int n;
int a[N];
int dp[N][20001];
const int buf = 20001 / 2;
const int mod = 1e9 + 7;
void add(int &a, int b) {
  long long res = (a + b) % mod;
  a = res;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) scanf("%d", a + i);
  for (int i = 0; i < n; ++i) dp[i][buf] = 1;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < buf * 2; ++j)
      if (dp[i][j] > 0) {
        add(dp[i + 1][j + a[i]], dp[i][j]);
        add(dp[i + 1][j - a[i]], dp[i][j]);
      }
  }
  int res = 0;
  for (int i = 1; i <= n; ++i) {
    add(res, dp[i][buf]);
  }
  res = (res + mod - n + 1) % mod;
  cout << res << endl;
}
