N, M = [int(s) for s in input().split()]
AS = {}
for _ in range(M):
    i = int(input())
    AS[i] = 0
visited = {}

def dfs(i):
    if i == N:
        return 1
    if i > N:
        return 0
    if AS.get(i) == 0:
        return 0
    if i in visited:
        return visited[i]
    total = 0
    total += dfs(i + 1)
    total += dfs(i + 2)
    visited[i] = total
    return total

print(dfs(0), visited, AS)