#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
using namespace std;
typedef long long int ll;
#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}


int main() {
    int n,m;
    cin >> n >> m;
    int no[m+1];
    rep(i,m){
        cin >> no[i];
    }
    no[m] = 99999999;
    int count = 0;

    ll dp[n+1] = {};

    ll ans = 0;

    dp[0] = 1;
    dp[1] = 1;
    if(no[count]==1){
        dp[1] = 0;
        count++;
    }

    srep(i,2,n+1){
        dp[i] = dp[i-1] + dp[i-2];
        if(no[count]==i){
            dp[i] = 0;
            count++;
        }
    }

    cout << dp[n] << endl;
    return 0;
}
 
 
