N, M = map(int, input().split())
bool = [True] * N
for i in range(M):
    bool[int(input())-1] = False

dp = 0
m0 = 0
m1 = 1
Ans = 1
for i in range(N):
    if bool[i]:
        dp = m0 + m1
        m0 = m1
        m1 = dp
        if dp == 0:
            m1 = 1
    else:
        if i == N-1:
            print(0)
            exit()
        elif not bool[i+1]:
            print(0)
            exit()
        m0 = 0
        m1 = 0
        if dp != 0:
            Ans *= dp
        dp = 0
Ans *= dp
print(Ans % 1000000007)
