#include <bits/stdc++.h>
using namespace std;
int main() {
  int mod = 1e9 + 7;
  int n, m;
  cin >> n >> m;
  vector<int> a(m), dp(n + 1, 0);
  for (int i = 0; i < (m); ++i) {
    cin >> a[i];
    dp[a[i]] = -1;
    if (i != 0) {
      if (a[i] - a[i - 1] == 1) {
        cout << 0 << endl;
        return 0;
      }
    }
  }
  dp[0] = 1;
  dp[1] = (a[0] != 1);
  for (int i = 2; i <= n; i++) {
    if (dp[i] != -1) {
      dp[i] = dp[i - 1] + dp[i - 2];
      dp[i] %= mod;
    } else {
      dp[i] = 0;
    }
  }
  cout << dp[n] << endl;
  return 0;
}
