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