#include <bits/stdc++.h>
using namespace std;
const int Inf = 100100100;
const double EPS = 1e-9;
const int num = 1000000007;
vector<long long> a(10001);
int stairs(int n) {
  a[0] = 1;
  a[1] = 1;
  for (int i = 2; i < (int)n + 1; ++i) {
    a[i] = a[i - 1] + a[i - 2];
  }
  return a[n] % num;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  long long way = 1;
  int tmp = -1;
  int obs;
  int current = 1;
  for (int i = 0; i < (int)m; ++i) {
    cin >> obs;
    if ((obs - tmp) == 1) {
      way = 0;
      cout << way << '\n';
      exit(0);
    }
    way *= stairs(obs - current);
    current = obs + 1;
    tmp = obs;
  }
  way *= stairs(n - current);
  cout << way << '\n';
  return 0;
}
