n,k = map(int, input().split()) A = list(map(int, input().split())) s = [] for a in A: s.append(a) X = set(A) while s: v = s.pop() for x in range(1, 7): for a in A: if v-x == a-(7-x): if v-x >= 1: s.append(v-x) X.add(v-x) print(X) for x in range(1, 7): if 1+x in X and 1+(7-x) in X: print('No') exit() else: print('Yes')