n, m  = map(int, input().split()) 

A = [int(a) for a in input().strip()]

a0 = 1 
a1 = 1 if A[0] !=1 else 0 

ANS=[0]*(n+1)
ANS[0]=a0
ANS[1]=a1
Next = A[1:] if a1 !=0 else A
next = 0
for i in range(2,n+1) :
  if i == Next[next]:
    A[i] = 0
    next += 1 
  else:
    A[i] = A[i-2] + A[i-1] 
  
print(A[n])