#include <bits/stdc++.h>
using namespace std;
int count(int *a, int n, int m, int sum) {
  int countsum = 0;
  int flag = 0;
  if (sum == n) {
    return 1;
  } else if (sum > n) {
    return 0;
  }
  for (int i = 0; i < m; i++) {
    if (sum + 1 == a[i]) {
      flag = 1;
      break;
    }
  }
  if (flag == 0) {
    countsum += count(a, n, m, sum + 1);
  }
  flag = 0;
  for (int i = 0; i < m; i++) {
    if (sum + 2 == a[i]) {
      flag = 1;
      break;
    }
  }
  if (flag == 0) {
    countsum += count(a, n, m, sum + 2);
  }
  return countsum;
}
int main(void) {
  int n, m;
  cin >> n >> m;
  int *a = new int[m];
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  cout << count(a, n, m, 0);
  return 0;
}
