#include <bits/stdc++.h>
using namespace std;
void TypicalStairs() {
  int n;
  int m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < m; i++) cin >> a[i];
  stack<int> p;
  p.push(0);
  long long ans = 0;
  while (p.size() > 0) {
    int now = p.top();
    p.pop();
    bool flag = true;
    for (int i = 0; i < m; i++) {
      if (now == a[i]) flag = false;
    }
    if (flag == true) {
      if (now == n)
        ans++;
      else {
        if (now + 2 <= n) p.push(now + 2);
        if (now + 1 <= n) p.push(now + 1);
      }
    }
  }
  cout << ans << endl;
  return;
}
int main() { TypicalStairs(); }
