#include <bits/stdc++.h>
int ans = 0;
int bk[100010] = {0}, n, m;
int check(int step) {
  if (bk[step] != 0 || step > n) return 0;
  return 1;
}
void dfs(int step) {
  if (step == n) {
    ans++;
    return;
  } else if (step < n) {
    if (!check(step + 1) && !check(step + 2)) return;
    if (check(step + 1)) {
      dfs(step + 1);
    }
    if (check(step + 2)) {
      dfs(step + 2);
    }
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    int x;
    scanf("%d", &x);
    bk[x]++;
  }
  dfs(0);
  printf("%d\n", ans);
  return 0;
}
