#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, start, end;
  long long ans;
  cin >> n >> m;
  vector<int> a(m);
  vector<long long> fib(100000);
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  a.push_back(n + 1);
  for (int i = 0; i < m - 1; i++) {
    if (a[i + 1] - a[i] == 1) {
      cout << 0 << endl;
      return 0;
    }
  }
  fib[0] = 1;
  fib[1] = 1;
  for (int i = 2; i < fib.size(); i++) {
    fib[i] = fib[i - 1] + fib[i - 2];
  }
  ans = 1;
  start = 0;
  for (int i = 0; i < a.size(); i++) {
    end = a[i];
    ans = ans * fib[end - start - 1];
    ans %= 1000000007;
    start = end + 1;
  }
  cout << ans << endl;
}
