#include <bits/stdc++.h>
using namespace std;
const unsigned long long maxn = 1e8;
const int MOD = 1e9 + 7;
unsigned long long power(unsigned long long x, unsigned long long int y) {
  int res = 1;
  while (y > 0) {
    if (y & 1) res = (res * x + MOD) % MOD;
    y = y >> 1;
    x = (x * x) % MOD;
  }
  return res;
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n, m;
  cin >> n >> m;
  bool wrong[n + 1];
  memset(wrong, 0, sizeof wrong);
  bool isPossible = true;
  int x;
  for (int i = 0; i < m; i++) {
    cin >> x;
    wrong[x] = 1;
    if (wrong[x] == 1 && wrong[x - 1] == 1) {
      isPossible = false;
    }
  }
  if (!isPossible) {
    cout << 0;
    return 0;
  }
  unsigned long long arr[n + 1];
  memset(arr, 0, sizeof arr);
  arr[0] = 0;
  if (!wrong[1]) arr[1] = 1ll;
  if (!wrong[2]) {
    if (wrong[1])
      arr[2] = 1ll;
    else
      arr[2] = 2ll;
  }
  for (int i = 2; i <= n; i++) {
    if (!wrong[i]) {
      if (!wrong[i - 1]) arr[i] += arr[i - 1];
      if (!wrong[i - 2]) arr[i] += arr[i - 2];
      arr[i] += MOD;
    } else
      arr[i] = max(arr[i - 1], arr[i - 2]);
    arr[i] += MOD;
    arr[i] %= MOD;
  }
  cout << arr[n] % MOD;
  return 0;
}
