#include <bits/stdc++.h>
using namespace std;
int dp[100000 + 5];
int vis[100000 + 5];
int main() {
  int n, nu, m;
  cin >> n >> m;
  memset(vis, 0, sizeof vis);
  for (int i = 0; i < m; ++i) {
    cin >> nu;
    vis[nu] = 1;
  }
  dp[0] = 1;
  dp[1] = 1;
  for (int i = 2; i <= n; ++i) {
    if (vis[i]) {
      dp[i] = 0;
    } else {
      dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007;
    }
  }
  cout << dp[n] << endl;
  return 0;
}
