n,m = map(int, input().strip().split())
c = []
dic = {}
for i in range(m):
    a = int(input())
    c.append(a)
c.insert(0,0)
c.append(n)
dic[0] = 0
dic[1] = 1
dic[2] = 2
for i in range(100002):
    dic[i+3] = dic[i+1]+dic[i+2]
dic
res = 1
for i in range(len(c)-1):
    a = c[i+1]-c[i]-1
    res = res * dic[a]
print(res)