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

template <class T> inline bool chmax(T& a, T b)
{
	if (a < b)
    {
    	a = b;
      	return true;
    }
  	return false;
}
typedef long long ll;
const ll minimum = -10000000000;

int main ()
{
	int n, m;
  	cin >> n >> m;
  	ll dp[100010];
  	ll broken[100010];
  	for(int i = 0; i < m; i++)
    {
    	int a;
      	cin >> a;
      	broken[a] = false;
    }
  	dp[0] = 1;
  	for(int i = 0; i < n; i++)
    {
    	for(int j = i + 1; j <=min(n, i+2); j++)
        {
        	if(broken[j])
            {
            	dp[j] += dp[i;]
            }
        } 
    }
  	cout << dp[n] << endl;
  	return 0;
}