n, m = map(int, input().split())
a = [0] * m

for i in range(m):
    a[i] = int(input())

one = 1 in a
two = 2 in a

dp = [0] * (n + 1)

if (n == 1):
    if (one is True):
        ans = 0
    else:
        ans = 1

elif (n == 2):
    if (sum(a) == 0):
        ans = 2
    elif (sum(a) == 3):
        ans = 0
    else:
        ans = 1

else:
    dp[1] = 1
    dp[2] = 2
    if (one is True):
        dp[1] = 0
    if (one is True):
        dp[2] = 0

    for i in range(3, n + 1):
        if (i in a):
            pass
        else:
            dp[i] = dp[i - 1] + dp[i - 2]

    ans = dp[n]

print(ans)
