#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0; i < M; i++) {
    cin >> a.at(i);
  }
  vector<int> dp(N + 1);
  for (int i = 0; i <= N; i++) {
    dp[i] = 0;
  }
  bool flag1 = false;
  bool flag2 = false;
  for (int j = 0; j < M; j++) {
    if (a[j] == 1) {
      flag1 = true;
    }
    if (a[j] == 2) {
      flag2 = true;
    }
  }
  if (flag1 and flag2) {
    cout << 0 << endl;
    return 0;
  } else if (flag1) {
    dp[1] = 0;
    dp[2] = 1;
  } else if (flag2) {
    dp[1] = 1;
    dp[2] = 0;
  } else {
    dp[1] = 1;
    dp[2] = 2;
  }
  bool flag = false;
  for (int i = 3; i <= N; i++) {
    flag = false;
    for (int j = 0; j < M; j++) {
      if (a[j] == i) {
        flag = true;
      }
    }
    if (flag) {
      dp[i] = 0;
    } else {
      dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007;
    }
  }
  cout << dp[N] << endl;
  return 0;
}
