#include <bits/stdc++.h>
using namespace std;
int mem_table[100000] = {1, 1, 0};
bool broken_table[100000] = {};
int count(int n) {
  if (n == 0)
    return 1;
  else if (n == 1)
    return 1;
  else if (mem_table[n] != 0)
    return mem_table[n];
  else {
    if (broken_table[n - 1]) {
      return mem_table[n] = count(n - 2);
    } else if (broken_table[n - 2]) {
      return mem_table[n] = count(n - 1);
    } else {
      return mem_table[n] = (count(n - 1) + count(n - 2)) % 1000000007;
    }
  }
};
int main() {
  int N, M;
  cin >> N >> M;
  int last_tmp = -1;
  int tmp = 0;
  for (int i = 0; i < M; i++) {
    cin >> tmp;
    broken_table[tmp] = true;
    if (tmp - last_tmp == 1) {
      cout << 0 << endl;
      return 0;
    }
    last_tmp = tmp;
  }
  cout << count(N) << endl;
}
