#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  int N, M, a[100001] = {0};
  ll dp[100001] = {0};
  cin >> N >> M;
  for (int n(0); n < M; n++) {
    int ai;
    cin >> ai;
    a[ai] = 1;
  }
  dp[0] = 1;
  for (int i(0); i < N; i++) {
    if (a[i + 1] != 1) dp[i + 1] += dp[i];
    if (i != N - 1)
      if (a[i + 2] != 1) dp[i + 2] += dp[i];
  }
  cout << dp[N] % 1000000007;
}
