#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  const int offset = 1e5 + 1;
  vector<int> dp(2 * offset + 5, 0);
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    vector<int> dp2(2 * offset + 5, 0);
    for (int j = 0; j < 2 * offset + 5; j++) {
      if (j + x < 2 * offset + 5) {
        dp2[j + x] += dp[j];
        if (dp2[j + x] >= mod) dp2[j + x] -= mod;
      }
      if (j - x >= 0) {
        dp2[j - x] += dp[j];
        if (dp2[j - x] >= mod) dp2[j - x] -= mod;
      }
    }
    ans += dp2[offset];
    if (ans >= mod) ans -= mod;
    dp2[offset + x]++;
    dp2[offset - x]++;
    if (dp2[offset + x] >= mod) dp2[offset + x] -= mod;
    if (dp2[offset - x] >= mod) dp2[offset - x] -= mod;
    dp = dp2;
  }
  cout << ans;
  return 0;
}
