#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M, now = 0;
  cin >> N >> M;
  int64_t ans = 1;
  vector<int64_t> S(N);
  for (int i = 0; i < N; i++) {
    if (i == 0) {
      S.at(0) = 1;
    } else if (i == 1) {
      S.at(1) = 1;
    } else {
      S.at(i) = S.at(i - 1) + S.at(i - 2);
    }
  }
  for (int i = 0; i < M; i++) {
    int a;
    cin >> a;
    int b = a - now;
    if (b == 0) {
      cout << 0 << endl;
      return 0;
    }
    now = a + 1;
    ans = ans * S.at(b - 1) % 1000000007;
  }
  ans = ans * S.at(N - now) % 1000000007;
  cout << ans << endl;
}
