#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  int safeStep = 0;
  int A;
  int stepSum = 0;
  int stepSets[M + 1];
  int maxStepSets = 0;
  long long patterns[100000];
  long long ans = 1;
  for (int i = 0; i < M; i++) {
    cin >> A;
    stepSets[i] = A - safeStep - 1;
    if (stepSets[i] < 0) {
      cout << 0 << endl;
      return 0;
    }
    if (maxStepSets < stepSets[i]) {
      maxStepSets = stepSets[i];
    }
    safeStep = A + 1;
  }
  stepSets[M] = N - safeStep;
  if (stepSets[M] < 0) {
    cout << 0 << endl;
    return 0;
  }
  if (maxStepSets < stepSets[M]) {
    maxStepSets = stepSets[M];
  }
  patterns[0] = 1;
  patterns[1] = 1;
  for (int i = 2; i < maxStepSets + 1; i++) {
    patterns[i] = patterns[i - 2] + patterns[i - 1];
  }
  for (int i = 0; i < M + 1; i++) {
    ans *= patterns[stepSets[i]];
    if (ans > 1000000007) {
      ans = ans % 1000000007;
    }
  }
  cout << ans << endl;
  return 0;
}
