#include <bits/stdc++.h>
using namespace std;
long long mem[100010];
bool l[100010];
int main() {
  int n, m;
  while (cin >> n >> m) {
    long long ans = 0;
    int x;
    for (int i = 0; i < m; ++i) {
      scanf("%d", &x);
      l[x] = 1;
    }
    mem[n] = 1;
    long long mod = 1e9 + 7;
    for (int i = n - 1; i >= 0; --i) {
      if (l[x]) continue;
      mem[i] = mem[i + 1] + mem[i + 2];
      mem[i] %= mod;
    }
    cout << mem[0] << endl;
  }
  return 0;
}
