#include <bits/stdc++.h>
static const int INF = 0x3f3f3f3f;
static const long long INFL = 0x3f3f3f3f3f3f3f3fLL;
static const long double epsilon = 1e-15;
static const long double pi = acos((long double)-1);
using namespace std;
inline void init_io() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
const int MAX_N = 100001;
int arr[3 * MAX_N];
void rarr(int n) {
  for (int(i) = (0); (i) < (n); i++) cin >> arr[i];
}
int dp[MAX_N];
int mod = 1000000007;
int solve(int idx, int n) {
  if (idx == n) return 1;
  if (idx > n) return 0;
  if (dp[idx]) return dp[idx];
  if (arr[idx] == -1) return dp[idx] = 0;
  return dp[idx] = (solve(idx + 1, n) % mod + solve(idx + 2, n) % mod) % mod;
}
int main() {
  init_io();
  int n, m;
  cin >> n >> m;
  for (int(i) = (0); (i) < (m); i++) {
    int x;
    cin >> x;
    arr[x] = -1;
  }
  cout << solve(0, n) << '\n';
  return 0;
}
