#include <bits/stdc++.h>
using namespace std;
bool brokenSteps[100005];
int dp[100005];
int N;
int getWays(int currVertex) {
  if (currVertex == N) {
    return 1;
  }
  if (currVertex > N || brokenSteps[currVertex]) {
    return 0;
  }
  if (dp[currVertex] != -1) {
    return dp[currVertex];
  }
  int opt1 = getWays(currVertex + 1);
  int opt2 = getWays(currVertex + 2);
  dp[currVertex] = opt1 + opt2;
  return dp[currVertex];
}
int main() {
  int M;
  cin >> N >> M;
  for (int i = 0; i < N; i++) {
    brokenSteps[i] = false;
  }
  for (int i = 0; i < N; i++) {
    dp[i] = -1;
  }
  for (int i = 0; i < M; i++) {
    int x;
    cin >> x;
    brokenSteps[x] = true;
  }
  int numWays = getWays(0);
  cout << numWays << endl;
}
