#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a < b) swap(a, b);
  if (a % b == 0)
    return b;
  else
    return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
  long long g = gcd(a, b);
  return a * b / g;
}
long long N, M, a[100020];
long long ANS[100020];
const long long MOD = 1000000007;
int main() {
  cin >> N >> M;
  for (int i = 0; i < M; i++) {
    cin >> a[i];
  }
  ANS[0] = 1;
  if (a[0] == 1)
    ANS[1] = 0;
  else
    ANS[1] = 1;
  int counter = 0;
  for (int i = 2; i <= N; i++) {
    while (a[counter] < i) {
      counter++;
    }
    if (a[counter] == i) {
      ANS[i] = 0;
    } else {
      ANS[i] = ANS[i - 1] + ANS[i - 2];
      ANS[i] %= MOD;
    }
  }
  ANS[N] %= MOD;
  cout << ANS[N];
}
