#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 10;
int n, v[maxn], dp[2][maxn * 20];
const int mod = 1e9 + 7, maxv = 1e4;
inline int scan() {
  int n = 0, x = getchar(), s = 1;
  for (; x < '0' || x > '9'; x = getchar())
    if (x == '-') s = -1;
  for (; x >= '0' && x <= '9'; x = getchar()) n = 10 * n + x - '0';
  return n * s;
}
inline int sum(int a, int b) { return ((a % mod) + (b % mod)) % mod; }
template <typename... Args>
inline int sum(int a, int b, Args... args) {
  return sum(sum(a, b), args...);
}
inline int num(int x) { return (x % 2); }
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  n = scan();
  for (int i = 1; i <= n; i++) v[i] = scan();
  int ans = 0;
  dp[num(n)][maxv] = dp[num(n)][maxv - v[n]] = dp[num(n)][maxv + v[n]] = 1;
  for (int i = n - 1; i >= 1; --i) {
    for (int j = 0; j <= 2 * maxv; j++) {
      dp[num(i)][j] =
          sum((j + v[i] <= 2 * maxv ? dp[num(i + 1)][j + v[i]] : 0),
              (j - v[i] >= 0 ? dp[num(i + 1)][j - v[i]] : 0), int(j == maxv));
    }
    ans += (dp[num(i)][maxv] - 1) % mod;
    ans %= mod;
  }
  cout << (ans + mod) % mod << "\n";
  return 0;
}
