#include <bits/stdc++.h>
using namespace std;
constexpr long long int MOD = 1e9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long int> a(m), b(n + 1);
  for (auto& e : a) cin >> e;
  b[0] = 1;
  b[1] = (a[0] == 1 ? 0 : 1);
  for (int i = 1, l = (a[0] == 1); i + 1 < n + 1; i++) {
    if (i + 1 != a[l]) {
      b[i + 1] = b[i] + b[i - 1];
      b[i + 1] %= MOD;
    } else {
      if (i + 2 != a[l + 1]) {
        b[i + 1] = 0;
      } else {
        b[0] = 0;
      }
      l = min(l + 1, m - 1);
    }
  }
  cout << b[0] * b[n] << endl;
  return 0;
}
