import time
MOD = 10**9+7

n,m = map(int,input().split())

stime = time.time()
F=[0]*(n+1)
F[0]=1
F[1]=2
for i in range(2,n):
    F[i]=(F[i-1]+F[i-2])%MOD

etime =time.time()


a=[0]*(n+1)
ans=1
for i in range(m):
      a[int(input())-1]+=1

io=-1
for i in range(n-1):
      if 0!=a[i] :
            io=i+1
            if 0!=a[i+1]:
                  print("0")
                  exit()
      else:
            if a[i+1] and i-io>1 :
                  ans*=F[i-io-1]%MOD
                  s=0
i=n-1
if i-io>0 :
      ans*=F[i-io-1]%MOD
print(ans%MOD)       import time time MOD = 10**9+7 MOD 10**9+7 10**9 10 9 7 n,m = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m stime = time.time() stime time.time() time.time time time F=[0]*(n+1) F [0]*(n+1) [0] 0 n+1 n 1 F[0]=1 F[0] F 0 1 F[1]=2 F[1] F 1 2 for i in range(2,n):
    F[i]=(F[i-1]+F[i-2])%MOD i range(2,n) range 2 n F[i]=(F[i-1]+F[i-2])%MOD F[i] F i (F[i-1]+F[i-2])%MOD F[i-1]+F[i-2] F[i-1] F i-1 i 1 F[i-2] F i-2 i 2 MOD etime =time.time() etime time.time() time.time time time a=[0]*(n+1) a [0]*(n+1) [0] 0 n+1 n 1 ans=1 ans 1 for i in range(m):
      a[int(input())-1]+=1 i range(m) range m a[int(input())-1]+=1 a[int(input())-1] a int(input())-1 int(input()) int input() input 1 1 io=-1 io -1 for i in range(n-1):
      if 0!=a[i] :
            io=i+1
            if 0!=a[i+1]:
                  print("0")
                  exit()
      else:
            if a[i+1] and i-io>1 :
                  ans*=F[i-io-1]%MOD
                  s=0 i range(n-1) range n-1 n 1 if 0!=a[i] :
            io=i+1
            if 0!=a[i+1]:
                  print("0")
                  exit()
      else:
            if a[i+1] and i-io>1 :
                  ans*=F[i-io-1]%MOD
                  s=0 0!=a[i] 0 a[i] a i io=i+1 io i+1 i 1 if 0!=a[i+1]:
                  print("0")
                  exit()
       0!=a[i+1] 0 a[i+1] a i+1 i 1 print("0") print "0" exit() exit if a[i+1] and i-io>1 :
                  ans*=F[i-io-1]%MOD
                  s=0 a[i+1] and i-io>1 a[i+1] a i+1 i 1 i-io>1 i-io i io 1 ans*=F[i-io-1]%MOD ans F[i-io-1]%MOD F[i-io-1] F i-io-1 i-io i io 1 MOD s=0 s 0 i=n-1 i n-1 n 1 if i-io>0 :
      ans*=F[i-io-1]%MOD i-io>0 i-io i io 0 ans*=F[i-io-1]%MOD ans F[i-io-1]%MOD F[i-io-1] F i-io-1 i-io i io 1 MOD print(ans%MOD) print ans%MOD ans MOD F=[0]*(n+1) [0]*(n+1) F etime =time.time() time.time() etime a=[0]*(n+1) [0]*(n+1) a ans=1 1 ans io=-1 -1 io ans*=F[i-io-1]%MOD F[i-io-1]%MOD ans i=n-1 n-1 i io=i+1 i+1 io m = map(int,input().split()) map(int,input().split()) m s=0 0 s stime = time.time() time.time() stime MOD = 10**9+7 10**9+7 MOD n,m = map(int,input().split()) map(int,input().split()) n ans*=F[i-io-1]%MOD F[i-io-1]%MOD ans
import time
MOD = 10**9+7

n,m = map(int,input().split())

stime = time.time()
F=[0]*(n+1)
F[0]=1
F[1]=2
for i in range(2,n):
    F[i]=(F[i-1]+F[i-2])%MOD

etime =time.time()


a=[0]*(n+1)
ans=1
for i in range(m):
      a[int(input())-1]+=1

io=-1
for i in range(n-1):
      if 0!=a[i] :
            io=i+1
            if 0!=a[i+1]:
                  print("0")
                  exit()
      else:
            if a[i+1] and i-io>1 :
                  ans*=F[i-io-1]%MOD
                  s=0
i=n-1
if i-io>0 :
      ans*=F[i-io-1]%MOD
print(ans%MOD)      
