#%%
import sys
def input():
    return sys.stdin.readline().rstrip()

def main():
    N, M = map(int, input().split())
    a_list = [int(input()) for _ in range(M)]

    def comb(N):
        if N<0:
            return 0
        if N==0:
            return 1

        dp=[[0 for _ in range(N+1)] for _ in range(3)]

        for j in range(1,N+1):
            for i in [1,2]:
                if j == i:
                    dp[i][j] = 1
                else:
                    dp[i][j] = dp[1][j-i] + dp[2][j-i]
        return dp[1][N]+dp[2][N]

    divider = 1000000007
    p = 0
    ans = 1

    for a in a_list:
        r = comb(a-1-p)%divider
        ans = (ans*r)%divider 
        p = a + 1
    else:
        if a < N:
            r = comb(N-p)%divider
            ans = (ans*r)%divider

    print(ans)
        

# %%
if __name__ == '__main__':
    main()

# %%
# from atcoder_test import doTest
# doTest("abc129","c",main)