#include <bits/stdc++.h>

#define rep(i, n) for(int i = 0; i < (n); ++i)
#define pb push_back
#define ALL(obj) (obj).begin(), (obj).end()      //昇順
#define RALL(obj) (obj).rbegin(), (obj).rend()   //降順
#define print(obj) cout << obj << endl
#define scan(obj) cin >> obj

typedef long long ll;

using namespace std;

int main(void){
    int n, m;
    cin >> n >> m;
    vector<int> dp(n);
    bool a[n] = {};
    rep(i, m){
        int temp;
        cin >> temp;
        a[temp - 1] = true;
    }
    dp[0] = 1; dp[1] = 2;
    for(int i = 2; i < n; i++){
        dp[i] = dp[i - 1] + dp[i - 2];
        if(a[i]) dp[i] = 0;
    }
    print(dp[n - 1]);
}
