#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> dp(n + 1);
  vector<int> cs(m);
  for (int(i) = 0; (i) < (m); (i)++) {
    cin >> cs[i];
  }
  int csi = 0;
  dp[0] = 1;
  for (int i = 1; i <= n; i++) {
    if (cs[csi] == i) {
      csi++;
      dp[i] = 0;
      continue;
    }
    dp[i] = ((i != 1 ? dp[i - 2] : 0) + dp[i - 1]) % 1000000007;
  }
  cout << dp[n];
}
