#%%
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)]

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

    divider = 1000000007
    dp[0], dp[1] = 1, 1
    for i in range(2,N+1):
        dp[i]=(dp[i-1]+dp[i-2])%divider

    p = 0
    ans = 1
    for a in a_list:
        r = dp[a-1-p] if a-1 >= p else 0
        ans = (ans*r)%divider 
        p = a + 1
    else:
        if a < N:
            r = dp[N-p]%divider
            ans = (ans*r)%divider

    print(ans)
        

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

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