#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m + 2);
  for (int i = 1; i < m + 1; i++) {
    cin >> a[i];
    if (a[1] == 0) {
      cout << 0 << endl;
      return 0;
    } else if (i > 0 && a[i + 1] - a[i] == 1) {
      cout << 0 << endl;
      return 0;
    }
  }
  a[0] = -1, a[m + 1] = n + 1;
  int div;
  long long ans = 1;
  for (int i = 0; i < m + 1; i++) {
    div = a[i + 1] - a[i] - 2;
    int front = div;
    int back = 0;
    long long f = 1, p = 1, q = 1;
    for (int i = 1; i < div + 1; i++) {
      f *= i;
    }
    while (front > 1) {
      front -= 2;
      back += 1;
      for (int i = 1; i < front + 1; i++) {
        p *= i;
      }
      for (int i = 1; i < front + 1; i++) {
        q *= i;
      }
      ans += f / p / q;
    }
  }
  cout << ans << endl;
}
