n, m = map(int, input().split())
a, stack = [0]*(n+1), [0]*(n+1)
for _ in range(m):
    ai = int(input())
    a[ai] = 1
stack[0] = 1
for i in range(1, n+1):
    if a[i] == 1:
        pass
    else:
        stack[i] = stack[i-1] + stack[i-2]
print(stack[-1])