from collections import deque


def Fibonacci(n): 
    if n<0: 
        print("Incorrect input") 
    # First Fibonacci number is 0 
    elif n==1: 
        return 1
    # Second Fibonacci number is 1 
    elif n==2: 
        return 2
    else: 
        return Fibonacci(n-1)+Fibonacci(n-2) 
        

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

A = deque()

for _ in range(M):
    A.append(int(input()))

pos = 0
diff = []

for a in A:
    d = (a - 1) - pos
    diff.append(d)
    pos = a + 1

# 最後の階段
diff.append(N - pos)

diff = list(filter(lambda x: False if x <= 0 else True, diff))

F = [Fibonacci(d) for d in diff]

_sum = 1
for f in F:
    _sum *= f

print(_sum)