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