#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0; i < (int)(M); i++) cin >> a[i];
  vector<int> s(N + 1, 0);
  for (int i = 0; i < (int)(M); i++) {
    s[a[i]]++;
  }
  long long dp[100010];
  for (int i = 0; i < (int)(100010); i++) dp[i] = 0;
  dp[0] = 1;
  if (s[1] == 0) dp[1] = dp[0];
  if (s[2] == 0) dp[2] = dp[0] + dp[1];
  for (int i = (2); i < (int)(N + 1); i++) {
    if (s[i] == 0) {
      if (dp[i - 1] != 0 && dp[i - 2] != 0) {
        dp[i] = dp[i - 1] + dp[i - 2];
      } else if (dp[i - 1] != 0 && dp[i - 2] == 0) {
        dp[i] = dp[i - 1];
      } else if (dp[i - 2] != 0 && dp[i - 1] == 0) {
        dp[i] = dp[i - 2];
      } else {
        cout << 0 << endl;
        return 0;
      }
    }
  }
  cout << dp[N] % 1000000007 << endl;
}
