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