#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const long long inf_ll = 1e18;
const int maxn = 12005, maxa = 30005;
const long long mod = 1000000007;
long long dp[maxa], temp[maxa];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  dp[maxn] = 1;
  long long out = 0;
  for (int i = 0; i < n; i++) {
    copy(dp, dp + maxa, temp);
    long long a;
    cin >> a;
    for (int j = a; j < maxa - a; j++)
      dp[j] = (temp[j - a] + temp[j + a]) % mod;
    dp[maxn] = (dp[maxn] + 1) % mod;
    out = (out + dp[maxn]) % mod;
  }
  cout << out - n << "\n";
}
