def Fib(n):
    a, b = 1, 1
    if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for i in range(n-2):
            a, b = b, a + b
        return b
N, M = map(int, input().split())
a = [int(input(i)) for i in range(M)]
m = 0
for i in range(M-1):
    if a[i] + 1 == a[i+1]:
        print(0)
        break
    else:
        for j in range(M-1):
            dev = a[j+1]-a[j]
            m += Fib(dev)
        print(m)