#include <bits/stdc++.h>
using namespace std;
const int INF = ~0U >> 1;
const int Mod = int(1e9) + 7;
const int maxN = 200000 + 100;
template <class T>
void tension(T &a, const T &b) {
  if (b < a) a = b;
}
template <class T>
void relax(T &a, const T &b) {
  if (b > a) a = b;
}
void addMod(int &x, int y) {
  x += y;
  if (x > Mod) x -= Mod;
}
int n, m, x;
int f[2][22000];
int main() {
  int ans = 0, now = 0, pre = 1;
  f[now][10000] = 1;
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int x;
    scanf("%d", &x);
    swap(now, pre);
    memset(f[now], (0), sizeof(f[now]));
    for (int i = 0; i < 22000; ++i)
      if (f[pre][i]) {
        if (i + x < 22000) addMod(f[now][i + x], f[pre][i]);
        if (i - x >= 0) addMod(f[now][i - x], f[pre][i]);
      }
    addMod(ans, f[now][10000]);
    addMod(f[now][10000], 1);
  }
  cout << ans;
  return 0;
}
