import sys

input = sys.stdin.readline

n, m = map(int, input().split())
a_list = []
comb_list = [0, 1, 2]
for _ in range(m):
    a = int(input())
    if a == 1:
        comb_list[a] = 0
        comb_list[a+1] = 1
    elif a == 2:
        comb_list[a] = 0
    else:
        a_list.append(a)
for i in range(3, n+1):
    if i in a_list:
        comb_list.append(0)
    else:
        comb_list.append((comb_list[-2]+comb_list[-1])%(10**9+7))
print(comb_list[n])
