n, m = map(int, input().split())
n += 1
a = [-1]
for i in range(m):
    a.append(int(input()))
a.append(n)
 
pattern = 0    
for i in range(1, len(a)):
#     print("for up to {}th step".format(a[i] - 1))
    step = [0] * (a[i] - a[i-1] - 1)
#     if a[i] - a[i-1] == 2:
#         step[1] = 1
#         for j in range(2, (a[i] - a[i-1])):
#             step[j] = step[j-1] + step[j-2]
#     else:
    step[1] = 1
    step[2] = 2
    for j in range(3, (a[i] - a[i-1] - 1)):
        step[j] = step[j-1] + step[j-2]
#     print(step)
#     print("there are {} patterns".format(max(step)))
    pattern += max(step)
print(pattern)