n, k = map(int, input().split()) a = list(map(int, input().split())) if k >= 4 and a[0] == 2 and a[1] == 3 and a[2] == 4 and a[3] == 5: print("No") else: if n >= 6: for i in range(1, k): if a[i - 1] >= 5 and abs(a[i - 1] - a[i]) == 1 and a[i - 1] % 6 == 3: exit(print("No")) print("Yes")