import sys

sys.setrecursionlimit(2147483647)

INF=float("inf")

MOD=10**9+7

input=sys.stdin.readline

def resolve():

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

    fib=[0,1]

    a,b=0,1

    for _ in range(n):

        a,b=b,(a+b)%MOD

        fib.append(b)

    A=[-1]+[int(eval(input())) for _ in range(m)]+[n+1]

    ans=1

    for i in range(m+1):

        ans*=fib[A[i+1]-A[i]-1]%MOD

    print((ans%MOD))



resolve()
import sys

INF = 1 << 60

MOD = 10**9 + 7 # 998244353

sys.setrecursionlimit(2147483647)

input = lambda:sys.stdin.readline().rstrip()

def resolve():

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

    S = set(int(eval(input())) for _ in range(m))



    a, b = 0, 1 # a[-1], a[0]

    for i in range(1, n + 1):

        if i in S:

            a, b = b, 0

        else:

            a, b = b, (a + b) % MOD



    print(b)

resolve()
import sys

sys.setrecursionlimit(2147483647)
INF = float("inf")
MOD = 10**9 + 7
input = sys.stdin.readline


def resolve():
    n, m = list(map(int, input().split()))
    fib = [0, 1]
    a, b = 0, 1
    for _ in range(n):
        a, b = b, (a + b) % MOD
        fib.append(b)
    A = [-1] + [int(eval(input())) for _ in range(m)] + [n + 1]
    ans = 1
    for i in range(m + 1):
        ans *= fib[A[i + 1] - A[i] - 1] % MOD
    print((ans % MOD))


resolve()

import sys

INF = 1 << 60
MOD = 10**9 + 7  # 998244353
sys.setrecursionlimit(2147483647)
input = lambda: sys.stdin.readline().rstrip()


def resolve():
    n, m = list(map(int, input().split()))
    S = set(int(eval(input())) for _ in range(m))
    a, b = 0, 1  # a[-1], a[0]
    for i in range(1, n + 1):
        if i in S:
            a, b = b, 0
        else:
            a, b = b, (a + b) % MOD
    print(b)


resolve()

+INF = 1 << 60 +MOD = 10**9 + 7  # 998244353 -INF = float("inf") -MOD = 10**9 + 7 -input = sys.stdin.readline +input = lambda: sys.stdin.readline().rstrip() -    fib = [0, 1] -    a, b = 0, 1 -    for _ in range(n): -        a, b = b, (a + b) % MOD -        fib.append(b) -    A = [-1] + [int(eval(input())) for _ in range(m)] + [n + 1] -    ans = 1 -    for i in range(m + 1): -        ans *= fib[A[i + 1] - A[i] - 1] % MOD -    print((ans % MOD)) +    S = set(int(eval(input())) for _ in range(m)) +    a, b = 0, 1  # a[-1], a[0] +    for i in range(1, n + 1): +        if i in S: +            a, b = b, 0 +        else: +            a, b = b, (a + b) % MOD +    print(b)