#include <bits/stdc++.h>
using namespace std;
using pp = pair<int, int>;
using ll = long long;
int main() {
  ll N, M, fin = 0, mod = pow(10, 9) + 7, S = 1;
  cin >> N >> M;
  vector<ll> a(M + 1, 0), b(N + 1, 1), A(M + 1);
  for (ll i = 0; i < M; i++) {
    cin >> a[i + 1];
  }
  for (ll i = 1; i < M; i++) {
    if (a[i + 1] - a[i] == 1) {
      fin = 1;
      break;
    }
  }
  a.push_back(N);
  if (fin == 1) {
    cout << 0 << endl;
  } else {
    for (ll i = 0; i <= M; i++) {
      A[i] = a[i + 1] - a[i] - 1;
    }
    b[1] = 1;
    b[2] = 2;
    for (ll i = 3; i <= N; i++) {
      ll B = b[i - 1] + b[i - 2];
      b[i] = B - B / mod * mod;
    }
    for (ll i = 0; i <= M; i++) {
      S *= b[A[i]];
      S = S - S / mod * mod;
    }
    cout << S << endl;
  }
}
