#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int n, dp[1001][40001], ans;
int main() {
  scanf("%d", &n);
  for (int i = 1, x; i <= n; i++) {
    scanf("%d", &x);
    for (int j = -10000; j <= 10000; j++)
      dp[i][20000 + j] = dp[i - 1][20000 + j + x] + dp[i - 1][20000 + j - x],
                    dp[i][20000 + j] %= MOD;
    dp[i][20000 + x]++;
    dp[i][20000 - x]++;
  }
  for (int i = 1; i <= n; i++) ans += dp[i][20000], ans %= MOD;
  printf("%d", ans);
}
