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