#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
int main() {
  int n, m;
  cin >> n >> m;
  int broken;
  int now = 0;
  vector<long long> v(n + 1);
  v[0] = 1;
  v[1] = 1;
  v[2] = 2;
  for (int i = 3; i < n + 1; i++) {
    v[i] = v[i - 1] + v[i - 2];
  }
  long long ans = 1;
  for (int i = 0; i < m; i++) {
    cin >> broken;
    if (now == broken) {
      cout << 0 << endl;
      return 0;
    }
    ans *= v[broken - 1 - now];
    now = broken + 1;
  }
  ans *= v[n - now];
  cout << ans % 1000000007 << endl;
}
