#include <bits/stdc++.h>
using namespace std;
struct cww {
  cww() {
    ios::sync_with_stdio(false);
    cin.tie(0);
  }
} star;
const long long INF = numeric_limits<long long>::max();
const int inf = numeric_limits<int>::max();
int am[100005];
int N, M;
vector<long long int> S(100005, -1);
long long int StepCnt(int n) {
  if (n == 1)
    return 1;
  else if (n == 2)
    return 2;
  else if (S[n] != -1)
    return S[n];
  bool flag[2] = {false};
  for (int i = 0; i < M; i++) {
    int next_step = N - n + 1;
    if (next_step == am[i]) {
      flag[0] = true;
    } else if (next_step + 1 == am[i]) {
      flag[1] = true;
    }
  }
  if (flag[0] == true && flag[1] == true)
    return S[n] = 0;
  else if (flag[0] == true)
    return S[n] = StepCnt(n - 2);
  else if (flag[1] == true)
    return S[n] = StepCnt(n - 1);
  else
    return S[n] = StepCnt(n - 2) + StepCnt(n - 1);
}
int main() {
  int n, m;
  cin >> n >> m;
  N = n;
  M = m;
  for (int i = 0; i < m; i++) cin >> am[i];
  long long int ans = StepCnt(n) % (1000000007);
  cout << ans << endl;
  return 0;
}
