#include <bits/stdc++.h>
int main() {
  static int dp[10000 + 1 + 10000], dq[10000 + 1 + 10000];
  int n, ans;
  scanf("%d", &n);
  ans = 0;
  while (n--) {
    int a, b;
    scanf("%d", &a);
    dp[10000] = (dp[10000] + 1) % 1000000007;
    memset(dq, 0, sizeof dq);
    for (b = -10000; b + a <= 10000; b++)
      dq[10000 + b + a] = (dq[10000 + b + a] + dp[10000 + b]) % 1000000007;
    for (b = 10000; b - a >= -10000; b--)
      dq[10000 + b - a] = (dq[10000 + b - a] + dp[10000 + b]) % 1000000007;
    memcpy(dp, dq, sizeof dq);
    ans = (ans + dp[10000]) % 1000000007;
  }
  printf("%d\n", ans);
  return 0;
}
