#include <bits/stdc++.h>
using namespace std;
long long a, b, k, n, m;
const long long maxn = 100005;
const long long mod = 1e9 + 7;
long long num[maxn];
bool broken[maxn];
int main() {
  while (cin >> n >> m) {
    ios_base::sync_with_stdio(false), cin.tie(0);
    memset(broken, 0, sizeof(broken));
    for (int i = 0; i < m; i++) {
      cin >> a;
      broken[a] = 1;
    }
    num[0] = 1;
    num[1] = 1;
    if (broken[1]) num[1] = 0;
    for (int i = 2; i <= n; i++) {
      if (broken[i])
        num[i] = 0;
      else {
        num[i] = num[i - 1] + num[i - 2];
        num[i] %= mod;
      }
    }
    cout << num[n] << "\n";
  }
}
