#include <bits/stdc++.h>
using namespace std;
long long M = 1000000007;
long long fill_ways(vector<long long>& ways, vector<bool>& broken, int index) {
  if (ways[index] == -1)
    ways[index] = broken[index] ? 0
                                : (fill_ways(ways, broken, index - 1) +
                                   fill_ways(ways, broken, index - 2)) %
                                      M;
  return ways[index];
}
int main(int argc, char const* argv[]) {
  int steps_amount, broken_amount;
  cin >> steps_amount >> broken_amount;
  vector<long long> ways(steps_amount + 1, -1);
  vector<bool> broken(broken_amount + 1, false);
  for (int i = 0; i < broken_amount; i++) {
    int j;
    cin >> j;
    broken[j] = true;
  }
  ways[0] = 1;
  ways[1] = broken[1] ? 0 : 1;
  cout << fill_ways(ways, broken, steps_amount) << "\n";
  return 0;
}
