#include <bits/stdc++.h>
using namespace std;
uint64_t MOD = 1000000007;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> A;
  A.push_back(-1);
  for (int m = 0; m < M; m++) {
    int a;
    cin >> a;
    A.push_back(a);
  }
  A.push_back(N + 1);
  vector<int64_t> Fibo(N + 1, 1);
  for (int i = 2; i < N + 1; i++) Fibo.at(i) = Fibo.at(i - 1) + Fibo.at(i - 2);
  int64_t ans = 1;
  for (int i = 1; i < A.size(); i++) {
    int d = (A.at(i) - 1) - (A.at(i - 1) + 1);
    if (d < 0) {
      ans = 0;
      break;
    }
    ans *= Fibo.at(d);
    ans %= MOD;
  }
  cout << ans << endl;
}
