n, m = map(int,input().split())
a = [int(input()) for i in range(m)]
b = [0] * (m+1)
b[0] = a[0] - 1
b[m] = n - a[-1] - 1
if m >= 2:
    for i in range(m-1, 0, -1):
        b[i] = a[i] - a[i-1] - 1
if 0 in b:
    print("0")  
else:         
    ans = 1
    step = [0] * (n+1)
    step[0] = 1
    step[1] = 1
    for i in range(2, n+1):
        step[i] = step[i-1] + step[i-2]
    for i in b:
        ans = ans * step[i]
    print(ans)  