N, M = map(int, input().split())
a = [int(input()) for i in range(M)]

def d(n: int) -> int:
    if n == N or n == N-1:
        return 1
    
    if not(n+1 in a) and not(n+2 in a):
        return d(n+1) + d(n+2)
    elif n+1 in a and not (n+2 in a):
        return d(n+2)
    else:
        return d(n+1)

flag = 0
for i in range(M-1):
    if a[i] == a[i+1]:
        flag = 1
        break
        
if flag == 1:
    print(0)
else:
    print(d(0) % 1000000007)