#include <bits/stdc++.h>
using namespace std;
long long s[100005] = {0};
long long step(long long k) {
  if (k == 1 || k == 0) return 1;
  if (s[k] != 0) return s[k];
  return s[k] = (step(k - 2) + step(k - 1)) % 1000000007;
}
int main() {
  cout << step(10000) << endl;
  long long n, m;
  cin >> n >> m;
  long long a[100005];
  long long sum = 1;
  a[0] = -1;
  for (long long i = 1; i <= m; i++) {
    cin >> a[i];
    if (a[i - 1] == a[i] - 1) {
      cout << 0 << endl;
      return 0;
    }
  }
  a[m + 1] = n + 1;
  for (long long i = 0; i <= m; i++) {
    sum *= step(a[i + 1] - a[i] - 2);
    sum %= 1000000007;
  }
  cout << sum << endl;
  return 0;
}
