#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
map<long long, long long> fList;
long long f(long long x) {
  if (fList.find(x) == fList.end()) {
    if (x == -1) {
      fList[-1] = 0;
    } else if (x == 0) {
      fList[0] = 1;
    } else {
      long long x_1 = f(x - 1);
      long long x_2 = f(x - 2);
      fList[x] = (x_1 + x_2) % 1000000007;
    }
  }
  return fList[x];
}
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> a(m + 2);
  a[0] = -1;
  for (long long i = 1; i < (long long)m + 1; i++) {
    long long b;
    cin >> b;
    a[i] = b;
  }
  a[m + 1] = n + 1;
  long long ans = 1;
  for (long long i = 0; i < (long long)(m + 1); i++) {
    long long tmp = f(a[i + 1] - a[i] - 2);
    ans *= tmp;
  }
  ans %= 1000000007;
  cout << ans << endl;
}
