#include <bits/stdc++.h>
using namespace std;
struct speed {
  speed() {
    cin.tie();
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(18);
  }
} speed;
int dy[] = {0, 0, 1, -1};
int dx[] = {1, -1, 0, 0};
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m, 0);
  vector<long long> cnt(n + 1, 1);
  for (int i = 0; i < (int)m; i++) {
    cin >> a[i];
    cnt[a[i]] = 0;
  }
  cnt[0] = 1;
  for (int i = 2; i <= n; i++) {
    cnt[i] = (cnt[i] != 0) ? cnt[i - 1] + cnt[i - 2] : 0;
  }
  cout << cnt[n] % 1000000007 << "\n";
}
