#include <bits/stdc++.h>
using namespace std;
long long retfib(long long n) {
  if (n == 1 || n == 0) return n;
  return retfib(n - 1) + retfib(n - 2);
}
int32_t main() {
  long long n, m, flag = 0;
  cin >> n >> m;
  vector<long long> v(m);
  for (long long i = 0; i < m; i++) {
    cin >> v[i];
    if (i != 0) {
      if (v[i] - v[i - 1] == 1) {
        flag = 1;
      }
    }
  }
  if (flag)
    cout << 0;
  else {
    long long x = 0, sum = 1;
    for (long long i = 0; i < m; i++) {
      long long temp = retfib(v[i] - x) % 1000000007;
      if (temp != 0) sum *= temp;
      x = v[i] + 1;
    }
    sum *= retfib(n + 1 - x) % 1000000007;
    cout << sum % 1000000007;
  }
}
