#include <bits/stdc++.h>
using namespace std;
vector<int> a;
bool binarySearch(int key) {
  int left = -1;
  int right = (int)a.size();
  while (right - left > 1) {
    int mid = left + (left - right) / 2;
    if (a[mid] >= key)
      right = mid;
    else
      left = mid;
  }
  if (right == key)
    return true;
  else
    return false;
}
int main() {
  int N, M;
  cin >> N >> M;
  vector<long long> dp(N + 10);
  a = vector<int>(M);
  for (int i = (int)(0); i < (int)(M); i++) {
    cin >> a[i];
  }
  dp[0] = 0;
  if (!binarySearch(1))
    dp[1] = 1;
  else
    dp[1] = 0;
  long long ans = 0;
  for (int i = (int)(0); i < (int)(N); i++) {
    if (binarySearch(i + 2))
      dp[i + 2] = 0;
    else
      dp[i + 2] = (dp[i + 1] + dp[i]) % 1000000007;
  }
  for (int i = (int)(0); i < (int)(M - 1); i++) {
    if (a[i + 1] == a[i] + 1) {
      cout << 0 << endl;
      return 0;
    }
  }
  cout << dp[N] << endl;
}
