#include <bits/stdc++.h>
using namespace std;
long long a[1000001];
long long pattern = 0;
long long N, M;
int saiki(int n, int idx) {
  if (n == N) {
    pattern++;
    return 0;
  } else if (n > N) {
    return 0;
  }
  if (n == a[idx] && idx < M) return 0;
  if (n > a[idx] && idx < M - 1) idx++;
  saiki(n + 1, idx);
  saiki(n + 2, idx);
  return 0;
}
int main() {
  cin >> N >> M;
  for (int i = 0; i < M; i++) {
    cin >> a[i];
    if (i > 0) {
      if (a[i] - a[i - 1] == 1) {
        cout << 0 << endl;
        return 0;
      }
    }
  }
  saiki(0, 0);
  cout << (pattern % 1000000007) << endl;
  return 0;
}
