#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const int N = 1e3 + 10;
const long long mud = 1e9 + 7;
int n, a[N];
int dp[N][(int)(2 * 1e4 + 2002)][2];
const int D = 1e4 + 1005;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) {
    for (int j = -1e4; j <= 1e4; j++) {
      dp[i][j + D][0] = (dp[i - 1][j + D][0] + dp[i - 1][j + D][1]) % mud;
      dp[i][j + D][1] =
          (dp[i - 1][j - a[i - 1] + D][1] + dp[i - 1][j + a[i - 1] + D][1]) %
          mud;
      if (a[i - 1] == j || -a[i - 1] == j)
        dp[i][j + D][1] = (dp[i][j + D][1] + 1) % mud;
    }
  }
  cout << (dp[n][0 + D][0] + dp[n][0 + D][1]) % mud << '\n';
  return 0;
}
