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