#include <bits/stdc++.h>
using namespace std;
static const long k10E7 = 1000000007;
int main() {
  long n, m;
  cin >> n >> m;
  vector<uint64_t> fib(n);
  for (long i = 0; i < n; i++) {
    if (i == 0) {
      fib[i] = 0;
      continue;
    }
    if (i == 1) {
      fib[i] = 1;
      continue;
    }
    fib[i] = fib[i - 1] + fib[i - 2];
  }
  uint64_t pattern = 1;
  long prev = -1;
  for (int i = 0; i < m; i++) {
    long broken = 0;
    cin >> broken;
    if (broken == prev) {
      continue;
    }
    if (broken == 1) {
      prev = broken;
      continue;
    }
    if (broken - prev == 1) {
      pattern = 0;
      break;
    }
    pattern *= fib[broken - prev - 1];
    pattern %= k10E7;
    prev = broken;
  }
  pattern *= fib[n - prev];
  pattern %= k10E7;
  cout << pattern << endl;
  return 0;
}
