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