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