#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y) {
  long long res = 1;
  x = x % 1000000007;
  while (y > 0) {
    if (y & 1) {
      res = (res * x) % 1000000007;
    }
    y = y >> 1;
    x = (x * x) % 1000000007;
  }
  return res;
}
long long inv(long long x) { return power(x, 1000000007 - 2); }
long long n, m, arr[1001], mx = (long long)4e18, mn = -(long long)4e18, ans,
                           dp[1001][20001];
long long fun(long long pos, long long sm) {
  if (pos >= n) {
    return 0;
  }
  if (dp[pos][10000 + sm] != -1) {
    return dp[pos][10000 + sm];
  }
  long long ways = 0;
  if (sm + arr[pos] == 0) {
    ways = (ways + 1) % 1000000007;
  }
  if (sm - arr[pos] == 0) {
    ways = (ways + 1) % 1000000007;
  }
  ways = (ways + fun(pos + 1, sm + arr[pos])) % 1000000007;
  ways = (ways + fun(pos + 1, sm - arr[pos])) % 1000000007;
  return dp[pos][10000 + sm] = ways;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  memset(dp, -1, sizeof(dp));
  for (int i = 0; i < n; i++) {
    ans = (ans + fun(i, 0)) % 1000000007;
  }
  cout << ans;
}
