#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int n, m;
int main() {
  cin >> n >> m;
  vector<int> ok(100000, 1);
  for (int i = 0; i < m; i++) {
    int p;
    cin >> p;
    ok[p] = 0;
  }
  vector<int> dp(100000, 0);
  dp[0] = 1;
  dp[1] = dp[0] * ok[1];
  for (int i = 0; i < n; i++) {
    dp[i + 2] = (dp[i + 1] * ok[i + 2] + dp[i] * ok[i + 2]) % MOD;
  }
  cout << dp[n] << endl;
}
