import sys
INFTY=sys.maxsize

def readinput():
    n,m=list(map(int,input().split()))
    a=[]
    for _ in range(m):
        a.append(int(input()))
    return n,m,a

def main(n,m,a):
    MOD=10**9+7
    dp=[0]*(n+3)
    dp[0]=1
    ia=0
    for i in range(n+1):
        if ia<m and i==a[ia]:
            ia+=1
            #print(ia)
            continue
        dp[i+1]=(dp[i+1]+dp[i])%MOD
        dp[i+2]=(dp[i+2]+dp[i])%MOD
        #print(dp)
    return dp[n]

if __name__=='__main__':
    n,m,a=readinput()
    ans=main(n,m,a)
    print(ans)
 import sys sys INFTY=sys.maxsize INFTY sys.maxsize sys maxsize def readinput():
    n,m=list(map(int,input().split()))
    a=[]
    for _ in range(m):
        a.append(int(input()))
    return n,m,a readinput n,m=list(map(int,input().split())) n list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split m a=[] a [] for _ in range(m):
        a.append(int(input()))
     _ range(m) range m a.append(int(input())) a.append a append int(input()) int input() input return n,m,a return n,m,a n m a def main(n,m,a):
    MOD=10**9+7
    dp=[0]*(n+3)
    dp[0]=1
    ia=0
    for i in range(n+1):
        if ia<m and i==a[ia]:
            ia+=1
            #print(ia)
            continue
        dp[i+1]=(dp[i+1]+dp[i])%MOD
        dp[i+2]=(dp[i+2]+dp[i])%MOD
        #print(dp)
    return dp[n] main MOD=10**9+7 MOD 10**9+7 10**9 10 9 7 dp=[0]*(n+3) dp [0]*(n+3) [0] 0 n+3 n 3 dp[0]=1 dp[0] dp 0 1 ia=0 ia 0 for i in range(n+1):
        if ia<m and i==a[ia]:
            ia+=1
            #print(ia)
            continue
        dp[i+1]=(dp[i+1]+dp[i])%MOD
        dp[i+2]=(dp[i+2]+dp[i])%MOD
        #print(dp)
     i range(n+1) range n+1 n 1 if ia<m and i==a[ia]:
            ia+=1
            #print(ia)
            continue
         ia<m and i==a[ia] ia<m ia m i==a[ia] i a[ia] a ia ia+=1 ia 1 continue dp[i+1]=(dp[i+1]+dp[i])%MOD dp[i+1] dp i+1 i 1 (dp[i+1]+dp[i])%MOD dp[i+1]+dp[i] dp[i+1] dp i+1 i 1 dp[i] dp i MOD dp[i+2]=(dp[i+2]+dp[i])%MOD dp[i+2] dp i+2 i 2 (dp[i+2]+dp[i])%MOD dp[i+2]+dp[i] dp[i+2] dp i+2 i 2 dp[i] dp i MOD return dp[n] dp[n] dp n n n m m a a if __name__=='__main__':
    n,m,a=readinput()
    ans=main(n,m,a)
    print(ans) __name__=='__main__' __name__ '__main__' n,m,a=readinput() n readinput() readinput m a ans=main(n,m,a) ans main(n,m,a) main n m a print(ans) print ans ans=main(n,m,a) main(n,m,a) ans def readinput():
    n,m=list(map(int,input().split()))
    a=[]
    for _ in range(m):
        a.append(int(input()))
    return n,m,a def readinput():
    n,m=list(map(int,input().split()))
    a=[]
    for _ in range(m):
        a.append(int(input()))
    return n,m,a readinput INFTY=sys.maxsize sys.maxsize INFTY def main(n,m,a):
    MOD=10**9+7
    dp=[0]*(n+3)
    dp[0]=1
    ia=0
    for i in range(n+1):
        if ia<m and i==a[ia]:
            ia+=1
            #print(ia)
            continue
        dp[i+1]=(dp[i+1]+dp[i])%MOD
        dp[i+2]=(dp[i+2]+dp[i])%MOD
        #print(dp)
    return dp[n] def main(n,m,a):
    MOD=10**9+7
    dp=[0]*(n+3)
    dp[0]=1
    ia=0
    for i in range(n+1):
        if ia<m and i==a[ia]:
            ia+=1
            #print(ia)
            continue
        dp[i+1]=(dp[i+1]+dp[i])%MOD
        dp[i+2]=(dp[i+2]+dp[i])%MOD
        #print(dp)
    return dp[n] main n,m,a=readinput() readinput() n m,a=readinput() readinput() m a=readinput() readinput() a
import sys
INFTY=sys.maxsize

def readinput():
    n,m=list(map(int,input().split()))
    a=[]
    for _ in range(m):
        a.append(int(input()))
    return n,m,a

def main(n,m,a):
    MOD=10**9+7
    dp=[0]*(n+3)
    dp[0]=1
    ia=0
    for i in range(n+1):
        if ia<m and i==a[ia]:
            ia+=1
            #print(ia)
            continue
        dp[i+1]=(dp[i+1]+dp[i])%MOD
        dp[i+2]=(dp[i+2]+dp[i])%MOD
        #print(dp)
    return dp[n]

if __name__=='__main__':
    n,m,a=readinput()
    ans=main(n,m,a)
    print(ans)

