#include<bits/stdc++.h>

using namespace std;

int main(){
int n, m;
cin >> n >> m;

int val[n+1] = {0};
int dp[n+1] = {0};
dp[0]=1;
int a;
for(int one = 0; one < m; one++){
cin >> a;
val[a] = 1;
}

if(val[1]){dp[1]=0;}
else{dp[1]=1;}
for(int one = 2; one < n+1; one++){
if(val[one]){dp[one]=0;}
else{dp[one] = dp[one-1]+dp[one-2];}
}

cout << dp[n];
}