#include <bits/stdc++.h>
using namespace std;
const int INF = 111111111;
const long long LLINF = 1e17 + 1;
const int DX[9] = {0, 0, 1, -1, 1, 1, -1, -1, 0};
const int DY[9] = {1, -1, 0, 0, 1, -1, 1, -1, 0};
const int DIV = 1000000007;
const double PI = 3.14159265358979323846264338327950288;
int main() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  int N, M;
  cin >> N >> M;
  vector<int> A(M + 2);
  for (int i = 1; i < M + 1; i++) {
    cin >> A[i];
  }
  A[0] = -1;
  A[M + 1] = (N + 1);
  for (int i = 0; i < M; i++) {
    if (A[i] + 1 == A[i + 1]) {
      cout << 0 << endl;
      return 0;
    }
  }
  vector<long long> kumi(100005);
  kumi[0] = 0;
  for (int i = 1; i < 100005; i++) {
    if (i == 1) {
      kumi[i] = 1;
    } else if (i == 2) {
      kumi[i] = 1;
    } else {
      kumi[i] = (kumi[i - 1] % DIV + kumi[i - 2] % DIV) % DIV;
    }
  }
  long long ans = 1;
  for (int i = 0; i < M + 1; i++) {
    ans *= kumi[A[i + 1] - A[i] - 1];
  }
  cout << ans % DIV << endl;
}
