def readinput():

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

    a=[]

    for _ in range(m):

        a.append(int(eval(input())))

    return n,a



def main(n,a):

    MOD=10**9+7



    nroute=[0]*(n+2)

    nroute[0]=0

    nroute[1]=1

    nroute[2]=1

    for i in range(3,n+2):

        nroute[i]=(nroute[i-1]+nroute[i-2])%MOD

    #print(nroute)

    

    subn=[]

    i=0

    for j in a:

        subn.append((i,j-1))

        i=j+1

    subn.append((i,n))

    #print(subn)



    nways=1

    for i,j in subn:

        l=j-i+1

        nways=nways*nroute[l]%MOD



    return nways



if __name__=='__main__':

    n,a=readinput()

    ans=main(n,a)

    print(ans)



import sys

INFTY=sys.maxsize



def readinput():

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

    a=[]

    for _ in range(m):

        a.append(int(eval(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)



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


def main(n, a):
    MOD = 10**9 + 7
    nroute = [0] * (n + 2)
    nroute[0] = 0
    nroute[1] = 1
    nroute[2] = 1
    for i in range(3, n + 2):
        nroute[i] = (nroute[i - 1] + nroute[i - 2]) % MOD
    # print(nroute)
    subn = []
    i = 0
    for j in a:
        subn.append((i, j - 1))
        i = j + 1
    subn.append((i, n))
    # print(subn)
    nways = 1
    for i, j in subn:
        l = j - i + 1
        nways = nways * nroute[l] % MOD
    return nways


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

import sys

INFTY = sys.maxsize


def readinput():
    n, m = list(map(int, input().split()))
    a = []
    for _ in range(m):
        a.append(int(eval(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 + +INFTY = sys.maxsize + + -    return n, a +    return n, m, a -def main(n, a): +def main(n, m, a): -    nroute = [0] * (n + 2) -    nroute[0] = 0 -    nroute[1] = 1 -    nroute[2] = 1 -    for i in range(3, n + 2): -        nroute[i] = (nroute[i - 1] + nroute[i - 2]) % MOD -    # print(nroute) -    subn = [] -    i = 0 -    for j in a: -        subn.append((i, j - 1)) -        i = j + 1 -    subn.append((i, n)) -    # print(subn) -    nways = 1 -    for i, j in subn: -        l = j - i + 1 -        nways = nways * nroute[l] % MOD -    return nways +    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] -    n, a = readinput() -    ans = main(n, a) +    n, m, a = readinput() +    ans = main(n, m, a)