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