mod = 10**9+7

def stairs(n):
    if n == 0:
        return 1
    elif n == 1:
        return 1
    else:
        return stairs(n-1)%mod+stairs(n-2)%mod

def main():
    n,m = map(int,input().split(' '))
    a=[-1]
    a_list=[]
    ans = 1
    for i in range(m):
        a.append(int(input()))
    a.append(n+1)
    for i in range(m+1):
        a_list.append(a[i+1]-a[i]-2)
    for i in a_list:
        if i <0:
            ans = 0
            break
        ans *= stairs(i)
        ans %= mod
    print(ans)

main()