#include <bits/stdc++.h>
using namespace std;
long long N, M;
vector<bool> h(100010, true);
vector<long long> dp(100010, 0);
int main() {
  cin >> N >> M;
  for (int i = 0; i < (M); i++) {
    int a;
    cin >> a;
    h[a] = false;
  }
  for (int i = 0; i < (N + 1); i++) dp[i] = 0;
  dp[0] = 1;
  for (int i = 1; i < N + 1; i++) {
    if (h[i] == false) continue;
    if (h[i - 1]) dp[i] += dp[i - 1];
    if (i > 1)
      if (h[i - 2]) dp[i] += dp[i - 2];
  }
  cout << dp[N] % 1000000007 << endl;
  return 0;
}
