#include <bits/stdc++.h>
using namespace std;
long long getFibonacci(int target) {
  long long f0 = 0, f1 = 1;
  long long fn = 1;
  for (long long i = 1; i < target; i++) {
    fn = f0 + f1;
    f0 = f1;
    f1 = fn;
  }
  return fn;
}
int main() {
  int N, M;
  cin >> N >> M;
  int a[M + 1];
  for (int i = 0; i < M; i++) {
    cin >> a[i];
  }
  a[M] = N + 1;
  long long ans = 1;
  int prev = -1;
  int diff;
  for (int i = 0; i < M + 1; i++) {
    diff = a[i] - prev;
    if (diff == 1) {
      cout << 0 << endl;
      return 0;
    }
    if (diff > 1) {
      ans = ans * getFibonacci(diff - 1) % 1000000007;
    }
    prev = a[i];
  }
  cout << ans << endl;
  return 0;
}
