#include <bits/stdc++.h>
using namespace std;
const long NUM = 1000000007;
int main() {
  int n, m;
  cin >> n >> m;
  vector<bool> ok(n + 1, true);
  for (int i = 0; i < m; ++i) {
    int input;
    cin >> input;
    ok[input] = false;
  }
  vector<long> dp(n + 1);
  for (int i = 0; i < n; ++i) {
    if (i == 0) dp[i] = 1;
    if (ok[i + 1]) dp[i + 1] += dp[i];
    if (ok[min(i + 2, n)]) dp[min(i + 2, n)] += dp[i];
  }
  cout << dp[n] % NUM << endl;
}
