#include <bits/stdc++.h>
using namespace std;
int f[1100][22000], N, r, s = 11000, D = 1e9 + 7;
int main() {
  cin >> N;
  for (int i = 1, x; i <= N; ++i) {
    cin >> x;
    ++f[i][s - x], ++f[i][s + x];
    for (int k = -s; k <= s; ++k)
      f[i][s + k] =
          (f[i][s + k] + (f[i - 1][s + k - x] + f[i - 1][s + k + x] % D)) % D;
    r = (r + f[i][s]) % D;
  }
  cout << r << '\n';
}
