#include <bits/stdc++.h>
#include <cstdlib>
#include <cmath>
#include <algorithm>
using namespace std;
using ll = long long;
using P = pair<int,int>;
using Graph= vector<vector<int>>; 
#define rep(i,n) for (ll i=0; i < (n); ++i)
#define rep2(i,n,m) for(ll i=n;i<=m;i++)
#define rep3(i,n,m) for(ll i=n;i>=m;i--)
#define pb push_back
#define eb emplace_back
#define ppb pop_back
#define mpa make_pair
const ll INF=1e18 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}
 ll dp[n+1] 
int main(){
 int n,m;cin>>n>>m ;
 vector<int> A(m) ;rep(i,m) cin>>A[i] ;
 
 dp[0]=1 ;
 rep(i,m){
   dp[A[i]]=-1 ;
 }
 if(A[0]==1) dp[1]=0 ;
 else dp[1]=1;
 rep2(i,2,n){
  if(dp[i]==-1) dp[i]=0 ;
  else{
    dp[i]=dp[i-1]+dp[i-2] ;
  }
   
 }
  cout<<dp[n] <<endl;
  return 0;
  }