#include <bits/stdc++.h>
using namespace std;
const int N = 1e4;
const int mod = 1e9 + 7;
int a[1003], f[1003][2 * N + 10], n, res = 0;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 1; i <= n; ++i) {
    f[i][N - a[i]]++;
    f[i][N + a[i]]++;
    for (int j = 0; j <= 2 * N; ++j) {
      if (j - a[i] >= 0) f[i][j] = (0LL + f[i][j] + f[i - 1][j - a[i]]) % mod;
      if (j + a[i] <= 2 * N)
        f[i][j] = (0LL + f[i][j] + f[i - 1][j + a[i]]) % mod;
    }
  }
  for (int i = 1; i <= n; ++i) res = (0LL + res + f[i][N]) % mod;
  cout << res;
}
