#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 0, 1, -1, 1, -1, 1, -1}, dy[] = {-1, 1, 0, 0, 1, -1, -1, 1};
void run();
int main() {
  ios::sync_with_stdio(0);
  cout << fixed << setprecision(16);
  run();
}
const long long mod = 1e9 + 7;
int mid = 10010;
int dp[1010][20020];
int n;
int a[1010];
int solve(int i, int j) {
  if (i == 0) return 0;
  int& res = dp[i][j + mid];
  if (res != -1) return res;
  res = 0;
  if (j == a[i] || j == -a[i]) res += 1;
  res = (res + solve(i - 1, j - a[i])) % mod;
  res = (res + solve(i - 1, j + a[i])) % mod;
  return res;
}
void run() {
  memset(dp, -1, sizeof dp);
  cin >> n;
  for (int i = (1); i < (n + 1); ++i) cin >> a[i];
  int res = 0;
  for (int i = (1); i < (n + 1); ++i) {
    res = (res + solve(i, 0)) % mod;
  }
  cout << res << "\n";
}
