#include <bits/stdc++.h>
using namespace std;
int min(int a, int b) {
  if (a > b) {
    return (b);
  } else {
    return (a);
  }
}
int max(int a, int b) {
  if (a < b) {
    return (b);
  } else {
    return (a);
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  int dan[n + 1];
  for (int i = 0; i <= n; i++) {
    dan[i] = 0;
  }
  for (int i = 0; i < m; i++) {
    int aa;
    cin >> aa;
    dan[aa] = -1;
  }
  if (dan[0] != -1) {
    dan[0] = 1;
  } else {
    dan[0] = 0;
  }
  if (dan[0] != -1 && dan[1] != -1) {
    dan[1] = 1;
  } else {
    dan[1] = 0;
  }
  for (int i = 2; i <= n; i++) {
    if (dan[i] != -1) {
      dan[i] = dan[i - 1] + dan[i - 2];
    }
  }
  cout << dan[n] << endl;
  return (0);
}
