#include <bits/stdc++.h>
using namespace std;
int n;
long long a[200010];
long long ji[200010], ou[200010];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
    if (i == 1)
      ji[i] = a[i];
    else if (i & 1)
      ji[i] = ji[i - 2] + a[i];
    else
      ou[i] = ou[i - 2] + a[i];
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    long long sum1, sum2;
    if (n & 1) {
      if (i & 1) {
        sum1 = ji[i] - a[i] + ou[n - 1] - ou[i - 1];
        sum2 = ou[i - 1] + ji[n] - ji[i];
      } else {
        sum1 = ji[i - 1] + ou[n - 1] - ou[i];
        sum2 = ou[i - 2] + ji[n] - ji[i - 1];
      }
    } else {
      if (i & 1) {
        sum1 = ji[i] - a[i] + ou[n] - ou[i - 1];
        sum2 = ou[i - 1] + ji[n - 1] - ji[i];
      } else {
        sum1 = ji[i - 1] + ou[n] - ou[i];
        sum2 = ou[i - 2] + ji[n - 1] - ji[i - 1];
      }
    }
    if (sum1 == sum2) ans++;
  }
  printf("%d\n", ans);
  return 0;
}
