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