import sys readline = sys.stdin.readline n = int(input()) d_arr = list(map(int, readline().split())) d_even = [] d_odd = [] for d in d_arr: if d % 2 == 0: d_even.append(d) else: d_odd.append(d) d_even.sort() d_odd.sort() x, y = map(lambda n: abs(int(n)), input().split()) if x == 0 and y == 0: print(0) sys.exit() for d in d_arr: if d == x + y: print(1) sys.exit()