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