mod = 10**9+7

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

main()