#include <bits/stdc++.h>
using namespace std;
int n;
int dangerous[1000001];
long long dp[1000001];
long long get(int cur) {
  long long result = 0;
  if (dp[cur]) return dp[cur];
  if (cur == n) return dp[cur] = 1;
  if (dangerous[cur + 1] == 0) {
    result += get(cur + 1) % 1000000007;
    result = result % 1000000007;
  }
  if (cur < n - 1 && dangerous[cur + 2] == 0) {
    result += get(cur + 2) % 1000000007;
    result = result % 1000000007;
  }
  return dp[cur] = result;
}
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int c;
    cin >> c;
    dangerous[c] = 1;
  }
  cout << get(0);
}
