#include <bits/stdc++.h>
using namespace std;
ifstream fin("f.in");
ofstream fout("f.out");
int n, m;
bool isBadStep[100001];
int ways[100001];
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int aux;
    cin >> aux;
    isBadStep[aux] = 1;
  }
  ways[1] = 1;
  ways[2] = isBadStep[1] ? 1 : 0;
  for (int i = 3; i <= n; i++) {
    int prevStepOne = i - 1;
    int prevStepTwo = i - 2;
    if (!isBadStep[prevStepOne]) ways[i] += ways[prevStepOne];
    if (!isBadStep[prevStepTwo]) ways[i] += ways[prevStepTwo];
    ways[i] %= 1000000007;
  }
  cout << ways[n] << '\n';
  return 0;
}
