#!/usr/bin/env python
# -*- coding: utf-8 -*-
 
s = list(map(int, input().split()))
N = s[0]
M = s[1]
flag = 0
 
def fib(n):
    a, b = 0, 1
    for i in range(n):
        a, b = b, a + b
    return b
 
 
s = [int(input()) for i in range(M)]
broken = []
broken.append(-1)
broken.extend(s)
broken.append(N+1)
#  -1段目とN+1段目が壊れていると表記して一貫した計算が可能に
 
gaps = []  # 壊れている段の間にある壊れていない段数
for i in range(M+1):
    gaps.append(broken[i+1]-broken[i]-1)
    if broken[i+1]-broken[i]-1 == 0:
        flag = 1
        break
 
 
fibs = []
if flag == 1:
    print(0)
else:
    for i in range(max(gaps)):
        fibs.append(fib(i))
        
    patterns = 1
    for i in range(len(gaps)):
        patterns *= fibs[gaps[i]-1]
    print(patterns % 1000000007)