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

a_list = []
former_a = -1
imp = False

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

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

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

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