n,k = map(int, input().split()) A = list(map(int, input().split())) A.sort() lim = 0 for i in range(k-1): for j in range(i+1, k): if A[j]-A[i] == 5: lim = max(lim, A[i]-9) if A[j]-A[i] == 3: lim = max(lim, A[i]-11) if A[j]-A[i] == 1: lim = max(lim, A[i]-11) if lim >= 1: print('No') exit() s = [] X = set(A) for a in A: s.append(a) while s: v = s.pop() for x in range(1, 7): if v-x >= 1: if v-x+(7-x) in X: X.add(v-x) s.append(v-x) if 1 in X: print('No') else: print('Yes')