#include <bits/stdc++.h>
using namespace std;
unsigned long long fibo(unsigned long long n) {
  int f0 = 0, f1 = 1, f2 = 1;
  for (int i = 0; i < (n); i++) {
    f2 = f0 + f1;
    f0 = f1;
    f1 = f2;
  }
  return f2;
}
int main() {
  int N, M;
  cin >> N >> M;
  ;
  if (M == 0) {
    cout << (fibo(N)) << endl;
    return 0;
  }
  vector<int> V;
  for (int i = 0; i < (M); i++) {
    int a;
    cin >> a;
    V.emplace_back(a);
  };
  for (int i = 0; i < (V.size() - 1); i++) {
    if (V.at(i) + 1 == V.at(i + 1)) {
      cout << (0) << endl;
      return 0;
    }
  }
  unsigned long long ans = 1;
  int ichi = 0;
  for (int i = 0; i < (V.size()); i++) {
    ans *= fibo(V.at(i) - 1 - ichi);
    ichi = V.at(i) + 1;
  }
  ans *= fibo(N - ichi);
  cout << (ans % 1000000007) << endl;
  return 0;
}
