#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, m;
  cin >> n >> m;
  vector<bool> a(n, 0);
  for (long long i = (0); i < (m); i++) {
    int x;
    cin >> x;
    a[x] = 1;
  }
  int dp[n];
  dp[0] = 1;
  dp[1] = a[1] ? 0 : 1;
  for (long long i = (2); i < (n); i++)
    (dp[i] = a[i] ? 0 : dp[i - 1] + dp[i - 2]) %= (1000000007);
  cout << dp[n - 1] << endl;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  solve();
  return 0;
}
