#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  int M;
  cin >> N >> M;
  vector<int> a;
  for (int i = 0; i < M; i++) {
    int a_;
    cin >> a_;
    a.push_back(a_);
  }
  long stairs[N + 1];
  stairs[0] = 1;
  if (count(a.begin(), a.end(), 1) == 1 && count(a.begin(), a.end(), 2) != 1) {
    stairs[1] = 0;
    stairs[2] = 1;
  } else if (count(a.begin(), a.end(), 1) != 1 &&
             count(a.begin(), a.end(), 2) == 1) {
    stairs[1] = 1;
    stairs[2] = 0;
  } else if (count(a.begin(), a.end(), 1) == 1 &&
             count(a.begin(), a.end(), 2) == 1) {
    stairs[1] = 0;
    stairs[2] = 0;
  } else {
    stairs[1] = 1;
    stairs[2] = 2;
  }
  for (int i = 0; i < N + 1; i++) {
    if (count(a.begin(), a.end(), i) == 1) {
      stairs[i] = 0;
    } else if (i > 2) {
      stairs[i] = (stairs[i - 1] + stairs[i - 2]) % 1000000007;
    }
  }
  cout << stairs[N] % 1000000007;
}
