#include <bits/stdc++.h>
using namespace std;
using Int = long long;
Int inf = 1000000000000000001LL;
using vi = vector<Int>;
using vvi = vector<vi>;
using mapis = unordered_map<Int, string>;
using mapii = unordered_map<Int, Int>;
using pii = pair<Int, Int>;
Int GCD(Int a, Int b) {
  if (b == 0) return a;
  if (a < b) return GCD(b, a);
  unsigned r;
  while ((r = a % b)) {
    a = b;
    b = r;
  }
  return b;
}
int binary_search_index(Int Y, vi &q) {
  int left = 0, right = q.size() - 1;
  while (right >= left) {
    int mid = left + (right - left) / 2;
    if (q[mid] == Y)
      return mid;
    else if (q[mid] > Y)
      right = mid - 1;
    else if (q[mid] < Y)
      left = mid + 1;
  }
  return -1;
}
int main() {
  Int N, M;
  cin >> N >> M;
  map<Int, int> a;
  Int ans;
  vvi dp = vvi(N + 1, vi(N + 1));
  Int tmp;
  for (Int i = 0; i < Int(M); i++) {
    cin >> tmp;
    a[tmp] = 1;
  }
  ans = 0;
  for (Int i = 0; i < Int(N + 1); i++) {
    dp[i][i] = 0;
  }
  dp[0][0] = 0;
  if (a[1] != 1) {
    dp[0][1] = 1;
  }
  if (a[2] != 1) {
    dp[0][2] = 1;
  }
  if (a[2] != 1 && a[1] != 1) {
    dp[0][2] = 2;
  }
  for (Int i = 0; i < Int(N + 1); i++) {
    if (i + 1 > N) {
      continue;
    }
    if (a[i + 1] != 1) {
      if (i - 1 >= 0) {
        dp[i][i + 1] += dp[i - 1][i];
      }
      if (i - 2 >= 0) {
        dp[i][i + 1] += dp[i - 2][i];
      }
    }
    if (i + 2 > N) {
      continue;
    }
    if (a[i + 2] != 1) {
      if (i - 1 >= 0) {
        dp[i][i + 2] += dp[i - 1][i];
      }
      if (i - 2 >= 0) {
        dp[i][i + 2] += dp[i - 2][i];
      }
    }
  }
  cout << (dp[N - 1][N] + dp[N - 2][N]) % 1000000007 << endl;
  return 0;
}
