#include <bits/stdc++.h>
using namespace std;
int main() {
  int mod = 1000000007;
  int n, m;
  cin >> n >> m;
  vector<long long> ans(n + 1, 0);
  ans[0] = 1;
  for (int i = 0; i < m; ++i) {
    int a;
    cin >> a;
    ans[a] = -1;
  }
  for (int i = 1; i <= n; ++i) {
    if (ans[i] == -1) continue;
    if (ans[i - 1] != -1) ans[i] += ans[i - 1];
    if (i - 2 >= 0 && ans[i - 2] != -1) ans[i] += ans[i - 2];
  }
  cout << ans[n] % mod << endl;
}
