#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000007;
int main() {
  int n, a;
  long long ans = 0, d[2][24010] = {0};
  scanf("%d", &n);
  for (int i = 0; n--; i ^= 1) {
    scanf("%d", &a);
    for (int j = 1000; j <= 21000; ++j)
      d[i][j] = (d[!i][j - a] + d[!i][j + a]) % INF;
    d[i][11000 + a]++;
    d[i][11000 - a]++;
    ans = (ans + d[i][11000]) % INF;
  }
  printf("%I64d\n", ans);
  return 0;
}
