#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<long long> a(n + 1, 0);
  vector<long long> f(n + 1, 0);
  int i, j;
  for (i = 0; i < m; i++) {
    int ai;
    cin >> ai;
    a[ai] = 1;
  }
  for (i = 0; i < n - 1; i++) {
    if (a[i] == 1 && a[i + 1] == 1) {
      cout << 0 << endl;
    }
  }
  f[0] = 1;
  f[1] = 1;
  for (i = 2; i <= n; i++) {
    f[i] = f[i - 1] + f[i - 2];
  }
  long long ans = 1;
  long long cnt = 1;
  for (i = 1; i <= n; i++) {
    if (a[i] == 1) {
      ans = ans * f[cnt - 1] % MOD;
      cnt = 0;
    } else {
      cnt++;
    }
  }
  if (cnt > 0) {
    ans = ans * f[cnt - 1] % MOD;
  }
  cout << ans << endl;
  return 0;
}
