#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  int a[N + 1];
  for (int i = 0; i <= N; i++) {
    a[i] = 0;
  }
  for (int i = 0; i < M; i++) {
    int A;
    cin >> A;
    a[A] = 1;
  }
  long long x, y;
  x = 1;
  if (a[1] == 0) {
    y = 1;
  } else {
    y = 0;
  }
  for (int i = 2; i < N; i++) {
    if (a[i] == 0) {
      long long z = y;
      y = (x + y) % 1000000007;
      x = z;
    } else {
      x = y;
      y = 0;
    }
  }
  cout << (x + y) % 1000000007 << endl;
}
