#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, M, res;
  cin >> N >> M;
  long long tmp;
  vector<long long> koware(M + 2);
  vector<long long> kumi(N + 2);
  kumi[0] = 0;
  kumi[1] = 1;
  kumi[2] = 1;
  for (long long j = 3; j <= N + 1; j++) {
    kumi[j] = kumi[j - 1] + kumi[j - 2];
  }
  koware[0] = -1;
  for (long long j = 1; j <= M; j++) {
    cin >> koware[j];
    if (j == 1) {
      if (koware[1] == 2) {
        koware[1] = 1;
      }
    }
  }
  koware[M + 1] = N + 1;
  res = 1;
  if (M != 0) {
    for (long long j = 0; j <= M; j++) {
      res *= kumi[(koware[j + 1] - koware[j] - 1)];
    }
  } else {
    res = kumi[(koware[M + 1] - koware[0] - 1)];
  }
  res = res % 1000000007;
  cout << res << endl;
}
