#include <bits/stdc++.h>
using namespace std;
long long c = 0;
void search(int N, int a[], int M, int now, int nowM) {
  if (now == N) {
    c++;
    return;
  }
  if (N < now) {
    return;
  }
  if (nowM < M && now == a[nowM]) {
    return;
  }
  if (nowM < M && now + 1 == a[nowM]) {
    search(N, a, M, now + 2, nowM + 1);
  } else if (nowM < M && now + 2 == a[nowM]) {
    search(N, a, M, now + 1, nowM);
  } else {
    search(N, a, M, now + 1, nowM);
    search(N, a, M, now + 2, nowM);
  }
}
int main() {
  int N, M;
  cin >> N >> M;
  int a[M];
  cin >> a[0];
  int before = a[0];
  for (int i = 1; i < M; i++) {
    cin >> a[i];
    if (a[i] - before < 2) {
      cout << 0 << endl;
      return 0;
    }
    before = a[i];
  }
  search(N, a, M, 0, 0);
  cout << c % 1000000007 << endl;
  return 0;
}
