#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int mod = (int)1e9 + 7;
  vector<int> dp(n, 0);
  vector<bool> broken(n, false);
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    broken[x - 1] = true;
  }
  if (!broken[0]) dp[0] = 1;
  if (!broken[1]) dp[1] = 2;
  for (int i = 2; i < n; i++) {
    if (broken[i]) continue;
    dp[i] = (dp[i - 1] % mod + dp[i - 2] % mod) % mod;
  }
  cout << dp[n - 1];
  return 0;
}
