#include <bits/stdc++.h>
#define int long long
using namespace std;

const int MOD  = 1e9 + 7;

int main()
{
  int n,m; cin>>n>>m;
  map<int,int> mp;
  int dp[[n + 1];
  for(int i = 0 ; i < m; i++){
  	int tm; cin>>tm;
    mp[tm] = 1;
    if(mp[tm - 1] == 1) return cout<<0,0;
  }
  dp[0] = 0;
  dp[1] = 1;
  for(int i = 2; i <= n; i++) {
    if(mp[i] == 0) continue; 
  	if(!mp[i - 1]) dp[i] += dp[i - 1];
    if(!mp[i - 2]) dp[i] += dp[i - 2];
  }
         cout<<dp[n];
  return 0;
}