import math
def fib(number):
    a, b = 0, 1
    if number == 1:
        return a
    elif number == 0:
        return b
    else:
        for _ in range(number-2):
            a, b = b, a + b
        return b
N, M = map(int, input().split())
a = []
ans = 1
tmp = 0
for _ in range(M):
    a.append(int(input()))
for i in a:
    number = i-1-tmp
    if number<1:
        print(0)
        exit()
    else:
        ans *= fib(number)
        tmp = i
print(number)