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