def Fib(n):
    a, b = 1, 1
    if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for i in range(n-2):
            a, b = b, a + b
        return b

n,m = map(int,input().split())
a = [int(input()) for _ in range(m)]

for i in range(len(a)-1):
    if a[i+1] == a[i]+1:
        print(0)
        exit()
x = []
temp=0
for i in range(m):
    x.append(a[i]-temp-1)
    temp = a[i]+1
x.append(n-temp)

temp = 1
div = 1000000007

for i in x:
    temp = (temp*Fib(i+1))%div

print(temp) def Fib(n):
    a, b = 1, 1
    if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for i in range(n-2):
            a, b = b, a + b
        return b Fib a, b = 1, 1 a 1 b 1 if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for i in range(n-2):
            a, b = b, a + b
        return b n == 1 n 1 return a a elif n == 2:
        return b
     n == 2 n 2 return b b for i in range(n-2):
            a, b = b, a + b
         i range(n-2) range n-2 n 2 a, b = b, a + b a b b a + b a b return b b n n n,m = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m int(input()) for _ in range(m) for _ in range(m) _ range(m) range m for _ in range(m) int(input()) int input() input a = [int(input()) for _ in range(m)] a [int(input()) for _ in range(m)] for i in range(len(a)-1):
    if a[i+1] == a[i]+1:
        print(0)
        exit() i range(len(a)-1) range len(a)-1 len(a) len a 1 if a[i+1] == a[i]+1:
        print(0)
        exit() a[i+1] == a[i]+1 a[i+1] a i+1 i 1 a[i]+1 a[i] a i 1 print(0) print 0 exit() exit x = [] x [] temp=0 temp 0 for i in range(m):
    x.append(a[i]-temp-1)
    temp = a[i]+1 i range(m) range m x.append(a[i]-temp-1) x.append x append a[i]-temp-1 a[i]-temp a[i] a i temp 1 temp = a[i]+1 temp a[i]+1 a[i] a i 1 x.append(n-temp) x.append x append n-temp n temp temp = 1 temp 1 div = 1000000007 div 1000000007 for i in x:
    temp = (temp*Fib(i+1))%div i x temp = (temp*Fib(i+1))%div temp (temp*Fib(i+1))%div temp*Fib(i+1) temp Fib(i+1) Fib i+1 i 1 div print(temp) print temp def Fib(n):
    a, b = 1, 1
    if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for i in range(n-2):
            a, b = b, a + b
        return b def Fib(n):
    a, b = 1, 1
    if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for i in range(n-2):
            a, b = b, a + b
        return b Fib a = [int(input()) for _ in range(m)] [int(input()) for _ in range(m)] a temp = a[i]+1 a[i]+1 temp n,m = map(int,input().split()) map(int,input().split()) n m = map(int,input().split()) map(int,input().split()) m temp = 1 1 temp x = [] [] x temp=0 0 temp temp = (temp*Fib(i+1))%div (temp*Fib(i+1))%div temp div = 1000000007 1000000007 div
def Fib(n):
    a, b = 1, 1
    if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for i in range(n-2):
            a, b = b, a + b
        return b

n,m = map(int,input().split())
a = [int(input()) for _ in range(m)]

for i in range(len(a)-1):
    if a[i+1] == a[i]+1:
        print(0)
        exit()
x = []
temp=0
for i in range(m):
    x.append(a[i]-temp-1)
    temp = a[i]+1
x.append(n-temp)

temp = 1
div = 1000000007

for i in x:
    temp = (temp*Fib(i+1))%div

print(temp)