#include <bits/stdc++.h>
using namespace std;
const unsigned long long maxn = 1e8;
const int MOD = 1e9 + 7;
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n, m;
  cin >> n >> m;
  vector<bool> wrong(n + 1);
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    wrong[x] = true;
  }
  vector<unsigned long long> ans(n + 1);
  ans[0] = 1;
  for (int i = 1; i <= n; i++) {
    ans[i] = (ans[i - 1] + ans[i - 2]) % MOD;
    if (wrong[i]) ans[i] = 0;
  }
  cout << ans[n];
}
