#include <bits/stdc++.h>
using namespace std;
int dfs(int now);
int n, m;
int step[100005] = {};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int a;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a;
    step[a] = -1;
  }
  cout << dfs(0) << '\n';
  return 0;
}
int dfs(int now) {
  if (step[now] == -1 || now > n) return 0;
  if (step[now] != 0) return step[now];
  if (now == n) return 1;
  return step[now] = (dfs(now + 1) + dfs(now + 2)) % 1000000007;
}
