#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
int main() {
  int n, m;
  cin >> n >> m;
  int a[m];
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  bool flg = true;
  int ans = -1;
  int cnt = 0;
  for (int i = 1; i < m; i++) {
    if (a[i - 1] + 1 == a[i]) {
      flg = false;
      cnt++;
      ans = 0;
      break;
    }
  }
  int f0 = 0;
  int f1 = 1;
  int f2;
  if (flg == true) {
    for (int i = 0; i < n; i++) {
      f2 = f1 + f0;
      f0 = f1;
      f1 = f2;
    }
  }
  if (n == 1) {
    cout << 1 << endl;
  } else if (n == 2) {
    cout << 2 << endl;
  } else if (flg == true) {
    cout << f1 << endl;
  } else {
    cout << 0 << endl;
  }
  return 0;
}
