N, M = map(int,input().split())
A_list = []
for i in range(M):
    A_list.append(int(input()))
if A_list[0] == 1:
    Dp_list = [1,0]
else:
    Dp_list = [1,1]
for i in range(2, N + 1):
    if i not in A_list:
        Dp_list.append(Dp_list[i-2] + Dp_list[i-1])
    elif i in A_list and i-1 in A_list:
        Dp_list = [0] * (N + 1)
        break
    else:
        Dp_list.append(0)
print(Dp_list[N]%1000000007)