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