#include <bits/stdc++.h>
using namespace std;
int n, m, a[100000], sh;
int s = 1;
int sm = 1000000007;
int fib(int x) {
  int f1 = 0;
  int f2 = 1;
  for (int i = 0; i < x; i++) {
    if (i % 2 == 0) f1 = f1 + f2;
    if (i % 2 == 1) f2 = f1 + f2;
  }
  return min(f1, f2);
}
int main() {
  a[0] = -1;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) cin >> a[i];
  for (int i = 1; i <= m; i++) {
    int du = a[i] - a[i - 1] - 1;
    if (du == 0) {
      cout << 0 << endl;
      return 0;
    }
    if (du != 1) {
      s = fib(du) * s;
    }
  }
  int du = n - a[m];
  s = fib(du) * s;
  cout << s << endl;
  return 0;
}
