#include <bits/stdc++.h>
using namespace std;
unsigned long Fibo(int n) {
  unsigned long f;
  switch (n) {
    case 1:
    case 2:
      f = 1;
      break;
    default:
      f = Fibo(n - 1) + Fibo(n - 2);
      break;
  }
  return (f);
}
int main() {
  int n, m, ite = 0, l, ans = 1;
  cin >> n >> m;
  int a[m + 1];
  while (std::cin >> l) {
    a[ite] = l;
    ite++;
    if (ite >= m) {
      break;
    }
  }
  a[m] = n;
  int tmp = 0;
  for (int i = 0; i < m + 1; i++) {
    ans *= Fibo(a[i] - tmp);
    tmp = a[i];
  }
  cout << ans;
  return 0;
}
