#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  bool ret = true;
  if (a < b) {
    a = b;
  } else {
    ret = false;
  }
  return ret;
}
template <class T>
inline bool chmin(T& a, T b) {
  bool ret = true;
  if (a > b) {
    a = b;
  } else {
    ret = false;
  }
  return ret;
}
unsigned int ana[100000] = {0};
unsigned long long dp[100000];
int main() {
  int N;
  int M;
  int ana_cnt;
  unsigned int ret = 1;
  unsigned int flag = 0;
  cin >> N;
  cin >> M;
  for (int i = 0; i < M; i++) {
    cin >> ana_cnt;
    if ((ana_cnt != 1) && (ana_cnt == (flag + 1))) {
      ret = 0;
    } else {
      ana[i] = ana_cnt;
      flag = ana_cnt;
    }
  }
  if (ret != 0) {
    dp[0] = 1;
    dp[1] = 1;
    for (int i = 2; i < N + 1; i++) {
      dp[i] = dp[i - 1] + dp[i - 2];
    }
    for (int i = 0; i < M; i++) {
      int b = ana[i];
      dp[b + 1] = dp[b - 1];
      dp[b + 2] = dp[b - 1];
      for (int j = b + 3; j < N + 1; j++) {
        dp[j] = dp[j - 1] + dp[j - 2];
      }
    }
    unsigned long long result = dp[N] % 100000007;
    cout << result << endl;
  } else {
    cout << 0 << endl;
  }
  return (0);
}
