#include <bits/stdc++.h>
int fibonach(int a) {
  int f0 = 0;
  int f1 = 1;
  int f2;
  for (int i = 0; i < a; i++) {
    f2 = f0 + f1;
    f0 = f1;
    f1 = f2;
  }
  return f2;
}
using namespace std;
int main() {
  int n, m, dan[10 * 10 * 10 * 10 * 10], cnt, poss = 1;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> dan[i];
  }
  for (int j = 0; j <= m - 2; j++) {
    cnt = dan[j + 1] - dan[j] - 1;
    poss *= fibonach(cnt);
  }
  cout << poss << endl;
  return 0;
}
