#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  vector<int> step(100001, 0);
  step[1] = 1;
  step[0] = 1;
  for (int i = 2; i <= 100000; i++) {
    step[i] = step[i - 1] + step[i - 2];
  }
  int start = 0;
  int n, m;
  vector<int> v;
  cin >> n;
  cin >> m;
  for (int i = 0; i < m; i++) {
    int t;
    cin >> t;
    v.push_back(t);
  }
  v.push_back(n + 1);
  long long int res = 1;
  const int mod = 1000000007;
  for (int i = 0; i < v.size(); i++) {
    if (start == v[i]) {
      cout << 0 << endl;
      return 0;
    }
    res *= step[v[i] - 1 - start];
    res %= mod;
    start = v[i] + 1;
  }
  cout << res << endl;
}
