def main(): N, K = map(int, input().split()) A = tuple(map(int, input().split())) if N == 1: n, m = divmod(A[0], K) if n % 2: if m: print('YES') else: print('NO') else: if m: print('NO') else: print('YES') return a = [] for i in A: if i: n, m = divmod(i, K) if n: a.extend([K] * n) if m: a.append(m) else: a.append(i) ans = a[0] for i in a[1:]: ans ^= i if ans: print('YES') else: print('NO') main()