n, m = [int(i) for i in input().split()]
b = [0] * n
b[0], b[1] = 1, 2
c = [0]*n
a = [int(input()) for _ in range(m)]
for i in a:
    c[i - 1] = 1
    b[i - 1] = 0
for i in range(2, n):
    if c[i] == 0:
        b[i] = b[i - 1] + b[i - 2]
print(b[-1])
