#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
int main() {
  ll MOD = 1000000007;
  int n, m;
  cin >> n >> m;
  vector<ll> a(m + 2);
  a[m + 1] = n + 1, a[0] = -1;
  for (int i = 0; i < (int)(m); i++) cin >> a[i + 1];
  for (int i = 0; i < (int)(m); i++) {
    if (a[i] + 1 == a[i + 1]) {
      cout << 0 << endl;
      return 0;
    }
  }
  vector<ll> b(n + 1);
  b[1] = 1, b[2] = 2;
  for (int i = 3; i <= n; i++) {
    b[i] = (b[i - 1] + b[i - 2]) % MOD;
  }
  ll ans = 1;
  for (int i = 0; i < (int)(m + 1); i++) {
    if (a[i + 1] != 1) {
      ans *= b[a[i + 1] - a[i] - 2];
      ans %= MOD;
    } else
      continue;
  }
  cout << ans << endl;
}
