#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
int n, m, broken[100010], store[100010];
bool binser(int key) {
  int low = 0, high = m - 1, mid;
  while (low <= high) {
    mid = (low + high) / 2;
    if (broken[mid] < key) {
      low = mid + 1;
    } else if (broken[mid] > key) {
      high = mid - 1;
    } else {
      return false;
    }
  }
  for (int i = max(0, mid - 3); i < min(m, mid + 3); ++i) {
    if (broken[i] == key) return false;
  }
  return true;
}
int dp(int step) {
  if (step == n || step == n - 1) return 1;
  if (store[step]) return store[step];
  bool one = binser(step + 1);
  bool two = binser(step + 2);
  int ans;
  if (one && two)
    return store[step] = dp(step + 1) % 1000000007 + dp(step + 2) % 1000000007;
  if (one) return store[step] = dp(step + 1) % 1000000007;
  if (two) return store[step] = dp(step + 2) % 1000000007;
  return 0;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    cin >> broken[i];
  }
  cout << dp(0) << endl;
}
