#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, x, broken[100010]{0};
  long long ans = 0LL, mod = 1000000007LL, D[100010];
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> x;
    broken[x - 1] = 1;
  }
  D[0] = !broken[0];
  D[1] = D[0] + !broken[1];
  for (int i = 2; i < n; i++) {
    if (broken[i]) {
      D[i] = 0;
    } else {
      D[i] = (D[i - 1] + D[i - 2]) % mod;
    }
  }
  ans = D[n - 1];
  cout << ans << '\n';
  return 0;
}
