#include <bits/stdc++.h>
using namespace std;
long long h[1000002];
long long ans[1000002];
signed main() {
  long long n, m;
  cin >> n >> m;
  long long a;
  for (long long i = 0; i <= n; i++) {
    h[i] = ans[i] = 0;
  }
  for (long long i = 0; i < m; i++) {
    cin >> a;
    h[a] = 1;
  }
  ans[0] = 1;
  for (long long i = 0; i < n; i++) {
    if (h[i + 1] == 0) ans[i + 1] += ans[i];
    if (h[i + 2] == 0) ans[i + 2] += ans[i];
    ans[i] %= 1000000007;
  }
  cout << ans[n] << endl;
  return (0);
}
