import sys
N, M = list(map(int, input().split()))

a_list = []
former_a = -1
imp = False

for _ in range(M):
    
    a_list.append(int(input()))
    if former_a < 0:
        former_a = a_list[-1]
    else:
        if a_list[-1] - former_a == 1:
            imp = True
            break

if imp:
    print(0)
else:
    a_list.extend([-1]*N)

    ans_list = [0, 1]
    for i in range(1, N+1, 1):

        if i == a_list[0]:
            a_list.pop(0)
            ans_list.append(0)
            pass
        else:
            ans_list.append(ans_list[-1] + ans_list[-2])
    print(ans_list[-1] % 1000000007)
        