#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool cmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
const long long INF = 1LL << 60;
vector<int> A;
long long dp[100010];
long long rec(int num) {
  if (dp[num] != INF) return dp[num];
  if (num == 0) return dp[num] = 1;
  if (binary_search(A.begin(), A.end(), num)) return dp[num] = 0;
  if (num > 1) {
    dp[num] = rec(num - 1) + rec(num - 2);
  } else if (num == 1) {
    dp[num] = 1;
  }
  return dp[num];
}
int main() {
  int N, M;
  cin >> N >> M;
  int prev = 0;
  bool flag = false;
  for (int i = 0; i < M; i++) {
    int n;
    cin >> n;
    if (i != 0 && abs(n - prev) == 1) {
      flag = true;
    }
    A.push_back(n);
    prev = n;
  }
  for (int i = 0; i < N + 1; i++) dp[i] = INF;
  if (!flag) {
    cout << rec(N) % 1000000007 << endl;
  } else {
    cout << 0 << endl;
  }
  return 0;
}
