import math

def cmb(n, r, mod, g1, g2):

    if ( r<0 or r>n ):

        return 0

    r = min(r, n-r)

    return g1[n] * g2[r] * g2[n-r] % mod



def main():

    N, M = list(map(int, input().split()))

    A = [-1] + [int(eval(input())) for i in range(M)] + [N + 1]



    mod = 10**9+7 #出力の制限

    N = 10**5

    g1 = [1, 1] # 元テーブル

    g2 = [1, 1] #逆元テーブル

    inverse = [0, 1] #逆元テーブル計算用テーブル

    for i in range( 2, N + 1 ):

        g1.append( ( g1[-1] * i ) % mod )

        inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )

        g2.append( (g2[-1] * inverse[-1]) % mod )



    d = [0] * (len(A) - 1)

    for i in range(len(A) - 1):

        if A[i+1] - A[i] == 1:

            print((0))

            exit(0)

        d[i] = A[i+1] - 1 - (A[i] + 1)



    ans = 1

    for dd in d:

        if dd > 1:

            tmp = 0

            for j in range(dd//2 + 1):

                tmp += cmb(dd - j, j, mod, g1, g2)

            ans *= tmp



    print((ans % 1000000007))



if __name__ == '__main__':

    main()

def main():

    N, M = list(map(int, input().split()))

    A = [int(eval(input())) for i in range(M)] + [0]



    a = 0

    b = 1

    j = 0

    tmp = 0

    if N == 1:

        print((1))

    else:

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

            if A[j] == i:

                if tmp == 1:

                    print((0))

                    exit()

                tmp = 1

                j += 1

                a = 0

            else:

                if tmp == 1:

                    b = a + b

                    a = 0

                else:

                    c = a + b

                    a = b

                    b = c

                tmp = 0

        print((b % 1000000007))



if __name__ == '__main__':

    main()

import math


def cmb(n, r, mod, g1, g2):
    if r < 0 or r > n:
        return 0
    r = min(r, n - r)
    return g1[n] * g2[r] * g2[n - r] % mod


def main():
    N, M = list(map(int, input().split()))
    A = [-1] + [int(eval(input())) for i in range(M)] + [N + 1]
    mod = 10**9 + 7  # 出力の制限
    N = 10**5
    g1 = [1, 1]  # 元テーブル
    g2 = [1, 1]  # 逆元テーブル
    inverse = [0, 1]  # 逆元テーブル計算用テーブル
    for i in range(2, N + 1):
        g1.append((g1[-1] * i) % mod)
        inverse.append((-inverse[mod % i] * (mod // i)) % mod)
        g2.append((g2[-1] * inverse[-1]) % mod)
    d = [0] * (len(A) - 1)
    for i in range(len(A) - 1):
        if A[i + 1] - A[i] == 1:
            print((0))
            exit(0)
        d[i] = A[i + 1] - 1 - (A[i] + 1)
    ans = 1
    for dd in d:
        if dd > 1:
            tmp = 0
            for j in range(dd // 2 + 1):
                tmp += cmb(dd - j, j, mod, g1, g2)
            ans *= tmp
    print((ans % 1000000007))


if __name__ == "__main__":
    main()

def main():
    N, M = list(map(int, input().split()))
    A = [int(eval(input())) for i in range(M)] + [0]
    a = 0
    b = 1
    j = 0
    tmp = 0
    if N == 1:
        print((1))
    else:
        for i in range(1, N + 1):
            if A[j] == i:
                if tmp == 1:
                    print((0))
                    exit()
                tmp = 1
                j += 1
                a = 0
            else:
                if tmp == 1:
                    b = a + b
                    a = 0
                else:
                    c = a + b
                    a = b
                    b = c
                tmp = 0
        print((b % 1000000007))


if __name__ == "__main__":
    main()

-import math - - -def cmb(n, r, mod, g1, g2): -    if r < 0 or r > n: -        return 0 -    r = min(r, n - r) -    return g1[n] * g2[r] * g2[n - r] % mod - - -    A = [-1] + [int(eval(input())) for i in range(M)] + [N + 1] -    mod = 10**9 + 7  # 出力の制限 -    N = 10**5 -    g1 = [1, 1]  # 元テーブル -    g2 = [1, 1]  # 逆元テーブル -    inverse = [0, 1]  # 逆元テーブル計算用テーブル -    for i in range(2, N + 1): -        g1.append((g1[-1] * i) % mod) -        inverse.append((-inverse[mod % i] * (mod // i)) % mod) -        g2.append((g2[-1] * inverse[-1]) % mod) -    d = [0] * (len(A) - 1) -    for i in range(len(A) - 1): -        if A[i + 1] - A[i] == 1: -            print((0)) -            exit(0) -        d[i] = A[i + 1] - 1 - (A[i] + 1) -    ans = 1 -    for dd in d: -        if dd > 1: -            tmp = 0 -            for j in range(dd // 2 + 1): -                tmp += cmb(dd - j, j, mod, g1, g2) -            ans *= tmp -    print((ans % 1000000007)) +    A = [int(eval(input())) for i in range(M)] + [0] +    a = 0 +    b = 1 +    j = 0 +    tmp = 0 +    if N == 1: +        print((1)) +    else: +        for i in range(1, N + 1): +            if A[j] == i: +                if tmp == 1: +                    print((0)) +                    exit() +                tmp = 1 +                j += 1 +                a = 0 +            else: +                if tmp == 1: +                    b = a + b +                    a = 0 +                else: +                    c = a + b +                    a = b +                    b = c +                tmp = 0 +        print((b % 1000000007))