#include <bits/stdc++.h>
std::vector<bool> step;
int n, m, a;
int c = 0;
int main() {
  std::cin >> n >> m;
  step.assign(n + 1, true);
  for (int i = 0; i < m; i++) {
    std::cin >> a;
    step[a] = false;
  }
  std::vector<int> dp(n + 1, 0);
  if (step[1] == false && step[2] == false) {
    std::cout << 0 << std::endl;
  }
  if (step[1] == true) {
    dp[1] = 1;
  } else {
    dp[1] = -1;
  }
  if (step[2] == true && step[1] == true) {
    dp[2] = 2;
  } else if (step[2] == true && step[1] == false) {
    dp[2] = 1;
  } else if (step[2] == false) {
    dp[2] = -1;
  }
  for (int i = 3; i <= n; i++) {
    if (step[i] == false) {
      dp[i] = -1;
    } else if (dp[i - 1] != -1 && dp[i - 2] != -1) {
      dp[i] = dp[i - 1] + 1;
    } else if (dp[i - 1] != -1 && dp[i - 2] == -1) {
      dp[i] = dp[i - 1] + 1;
    } else if (dp[i - 2] != -1 && dp[i - 1] == -1) {
      dp[i] = dp[i - 2] + 1;
    } else if (dp[i - 2] == -1 && dp[i - 1] == -1) {
      dp[i] = -1;
    }
  }
  if (dp[n] == -1) {
    std::cout << 0 << std::endl;
    return 0;
  }
  std::cout << dp[n - 1] % 1000000007 << std::endl;
}
