import sys
n,m=map(int,input().split())
a=[]
d=0
for i in range(m):
    a.append(int(input()))
a.append(0)
a.append(0)
a.append(0)
ans=[]
for i in range(m-1):
    if a[i+1]-a[i]==1:
        print(0)
        sys.exit()
ans=[0 for i in range(n+5)]
ans[1]=1
ans[2]=2

if a[0]==1:
    ans[1]=0
    ans[2]=1
    d+=1
if a[0]==2 or a[1]==2:
    ans[2]=0
    d+=1

for i in range(1,n+3):
    if i+2==a[d]:
        ans[i+2]=0
        d+=1
    else:
        ans[i+2]=ans[i+1]%1000000007+ans[i]%1000000007
   
print(ans[n]%1000000007)
    
    
    

         import sys sys n,m=map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m a=[] a [] d=0 d 0 for i in range(m):
    a.append(int(input())) i range(m) range m a.append(int(input())) a.append a append int(input()) int input() input a.append(0) a.append a append 0 a.append(0) a.append a append 0 a.append(0) a.append a append 0 ans=[] ans [] for i in range(m-1):
    if a[i+1]-a[i]==1:
        print(0)
        sys.exit() i range(m-1) range m-1 m 1 if a[i+1]-a[i]==1:
        print(0)
        sys.exit() a[i+1]-a[i]==1 a[i+1]-a[i] a[i+1] a i+1 i 1 a[i] a i 1 print(0) print 0 sys.exit() sys.exit sys exit 0 for i in range(n+5) for i in range(n+5) i range(n+5) range n+5 n 5 for i in range(n+5) 0 ans=[0 for i in range(n+5)] ans [0 for i in range(n+5)] ans[1]=1 ans[1] ans 1 1 ans[2]=2 ans[2] ans 2 2 if a[0]==1:
    ans[1]=0
    ans[2]=1
    d+=1 a[0]==1 a[0] a 0 1 ans[1]=0 ans[1] ans 1 0 ans[2]=1 ans[2] ans 2 1 d+=1 d 1 if a[0]==2 or a[1]==2:
    ans[2]=0
    d+=1 a[0]==2 or a[1]==2 a[0]==2 a[0] a 0 2 a[1]==2 a[1] a 1 2 ans[2]=0 ans[2] ans 2 0 d+=1 d 1 for i in range(1,n+3):
    if i+2==a[d]:
        ans[i+2]=0
        d+=1
    else:
        ans[i+2]=ans[i+1]%1000000007+ans[i]%1000000007
    i range(1,n+3) range 1 n+3 n 3 if i+2==a[d]:
        ans[i+2]=0
        d+=1
    else:
        ans[i+2]=ans[i+1]%1000000007+ans[i]%1000000007
    i+2==a[d] i+2 i 2 a[d] a d ans[i+2]=0 ans[i+2] ans i+2 i 2 0 d+=1 d 1 ans[i+2]=ans[i+1]%1000000007+ans[i]%1000000007 ans[i+2] ans i+2 i 2 ans[i+1]%1000000007+ans[i]%1000000007 ans[i+1]%1000000007 ans[i+1] ans i+1 i 1 1000000007 ans[i]%1000000007 ans[i] ans i 1000000007 print(ans[n]%1000000007) print ans[n]%1000000007 ans[n] ans n 1000000007 ans=[0 for i in range(n+5)] [0 for i in range(n+5)] ans d=0 0 d d+=1 1 d n,m=map(int,input().split()) map(int,input().split()) n d+=1 1 d d+=1 1 d a=[] [] a m=map(int,input().split()) map(int,input().split()) m ans=[] [] ans
import sys
n,m=map(int,input().split())
a=[]
d=0
for i in range(m):
    a.append(int(input()))
a.append(0)
a.append(0)
a.append(0)
ans=[]
for i in range(m-1):
    if a[i+1]-a[i]==1:
        print(0)
        sys.exit()
ans=[0 for i in range(n+5)]
ans[1]=1
ans[2]=2

if a[0]==1:
    ans[1]=0
    ans[2]=1
    d+=1
if a[0]==2 or a[1]==2:
    ans[2]=0
    d+=1

for i in range(1,n+3):
    if i+2==a[d]:
        ans[i+2]=0
        d+=1
    else:
        ans[i+2]=ans[i+1]%1000000007+ans[i]%1000000007
   
print(ans[n]%1000000007)
    
    
    

        
