#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<bool> flag(n + 1, true);
  for (int i = 1; i <= m; i++) {
    int a;
    cin >> a;
    flag[a] = false;
  }
  vector<long long> dp(n);
  dp[0] = 1;
  dp[1] = 1;
  if (!flag[1]) {
    dp[1] = 0;
  }
  for (int i = 2; i <= n; i++) {
    dp[i] = dp[i - 1] + dp[i - 2];
    dp[i] %= 1000000007;
    if (!flag[i]) {
      dp[i] = 0;
    }
  }
  cout << dp[n] << "\n";
  return 0;
}
