#include <bits/stdc++.h>
void calc(int num, std::vector<long long>& dp) {
  for (int i = 2; i <= num + 1; ++i) dp[i] = dp[i - 1] + dp[i - 2];
}
int main() {
  int N, M;
  std::vector<long long> a;
  long long keyValue = 1000000007;
  std::cin >> N >> M;
  std::vector<long long> dp(N + 2, 0);
  dp[0] = 0;
  dp[1] = 1;
  calc(N, dp);
  a.resize(M);
  for (int i = 0; i < M; ++i) std::cin >> a[i];
  long long ans = 1;
  for (int i = 0; i < a.size(); ++i) {
    if (i == 0) {
      long long num = a[0];
      ans *= (dp[num] % keyValue);
    } else {
      long long num = a[i] - a[i - 1] - 1;
      ans *= (dp[num] % keyValue);
    }
    if (ans == 0) {
      std::cout << 0 << std::endl;
      return 0;
    }
  }
  if (M > 0) {
    long long num = N - a[a.size() - 1];
    ans *= (dp[num] % keyValue);
  } else {
    std::cout << dp[N + 1] % keyValue << std::endl;
    return 0;
  }
  std::cout << ans % keyValue << std::endl;
  return 0;
}
