#include #include #include #include using namespace std; typedef long long int ll; const ll N = 100000; ll d[N],n,cp,src[2][N],lst[2]; int main() { cin >> n; for (int i = 0; i < n; i++) { scanf("%d", d + i); src[d[i] % 2][lst[d[i] % 2]] = d[i]; lst[d[i] % 2]++; } sort(d , d + n); sort(src[0], src[0] + lst[0]); sort(src[1], src[1] + lst[1]); ll x, y; cin >> x >> y; cp = abs(x) + abs(y); if (cp == 0) { cout << 0 << endl; goto end; } if (find(d, d + n, cp) - d < n) { cout << 1 << endl; goto end; } for (int i = 0; i < n; i++) { ll lb = abs(cp - d[i]), ub = (cp + d[i]); ll ni = lower_bound(src[lb % 2], src[lb % 2] + lst[lb % 2], lb) - src[lb % 2]; if (ni