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