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