#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  int n, m;
  ll dp[n + 1];
  cin >> n >> m;
  int broken[n + 1];
  for (int i = 0; i < n + 1; i++) broken[i] = 1;
  for (int i = 0; i < m; i++) {
    int t;
    cin >> t;
    broken[t] = 0;
  }
  dp[0] = 1;
  dp[1] = broken[1];
  for (int i = 2; i < n + 1; i++) {
    dp[i] =
        (dp[i - 1] * broken[i - 1] + dp[i - 2] * broken[i - 2]) % 1000000007;
  }
  cout << dp[n] << endl;
}
