# -*- coding: utf-8 -*-
N, M = map(int, input().split())
A = []
for _ in range(M):
    A.append(int(input()))

for s1, s2 in zip(A[1:], A[:-1]):
    if s1 - s2 == 1:
        print(0)
        break

else:
    
    num_goup = [1]
    for s in range(1, N + 1):
        if s in A:
            num_goup.append(0)
            continue
    
        if s == 1:
            num_goup.append(1)
            continue
    
        if num_goup[-1] == 0:
            num_goup.append(num_goup[-2])
        else:
            if num_goup[-2] == 0:
                num_goup.append(num_goup[-1])
            else:
                num_goup.append(num_goup[-1] + num_goup[-2])
    
    print(num_goup[-1] % 1000000007)