#include <bits/stdc++.h>
using namespace std;
constexpr int MOD = 1000000007;
int tab[2][20001];
int main() {
  int N;
  scanf("%d", &N);
  int cur = 0, prev = 1, count = 0;
  while (N--) {
    int v;
    scanf("%d", &v);
    for (int i = 0; i <= 20000; i++) tab[cur][i] = 0;
    tab[cur][10000 + v]++;
    tab[cur][10000 - v]++;
    for (int i = 0; i <= 20000; i++) {
      if (i + v <= 20000)
        tab[cur][i + v] = (tab[cur][i + v] + tab[prev][i]) % MOD;
      if (i - v >= 0) tab[cur][i - v] = (tab[cur][i - v] + tab[prev][i]) % MOD;
    }
    count = (count + tab[cur][10000]) % MOD;
    swap(cur, prev);
  }
  printf("%d\n", count);
}
