def fib(number):
    if(number<=2):
        return 1
    else:
        f = 1
        ff = 1
        for _ in range(number-1):
            tmp = ff
            ff = f + ff
            f = tmp
        return tmp

n, m = map(int, input().split())
a = []

frag = True
before = -100
for _ in range(m):
    tmp = int(input())
    if(tmp - before == 1):
        frag = False
    before = tmp
    a.append(tmp)


warukazu = 1000000007
if(frag):
    before = 0
    ans = 0
    if(m!=0):
        for i in range(m):
            if(i==0):
                ans = fib(a[i]-before)
            else:
                ans = ans * fib(a[i]-before-1)
                ans = ans % warukazu
            before = a[i]
        ans = ans * fib(n - before)
        ans = ans % warukazu
        print(ans)
    else:
        ans = fib(n - before)
        ans = ans % warukazu
        print(ans)
else:
    print(0)