def fib_memo(n):
    memo=["EMPTY"]*(n+1)
    def _fib(n):
        if n == 1:
            return 0
        elif n == 2:
            return 1
        elif memo[n] != "EMPTY":
            return memo[n]
        else:
            memo[n] = _fib(n-1)+_fib(n-2)
            return memo[n]
    return _fib(n)
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
cnt=fib_memo(a[0]-1)*fib_memo(n-a[m-1]-1)
for i in range(1,m-1):
  cnt*=fib_memo(a[i]-a[i-1]-1)
print(cnt)
  
  