#include <bits/stdc++.h>
using namespace std;
long long MOD = 10e8 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  int fib[n];
  int a[m + 2];
  for (int(i) = 0; (i) < (m); (i)++) {
    scanf("%d", &a[i]);
    a[i]--;
  }
  if (m < 1) {
    a[0] = 0;
    a[1] = 0;
  } else if (m < 2) {
    a[1] = 0;
  }
  int a_index = 0;
  if (a[0] == 0) {
    fib[0] = 0;
    a_index++;
    if (a[1] == 1) {
      fib[1] = 0;
      a_index++;
    } else {
      fib[1] = 1;
    }
  } else if (a[0] == 1) {
    fib[0] = 1;
    fib[1] = 0;
    a_index++;
  } else {
    fib[0] = 1;
    fib[1] = 2;
  }
  for (int i = 2; i < n; i++) {
    fib[i] = fib[i - 1] + fib[i - 2];
    if (a[a_index] == i) {
      fib[i] = 0;
      if (a_index != m) a_index++;
    } else {
      fib[i] = fib[i] % MOD;
    }
  }
  cout << (fib[n - 1]) << "\n";
  return 0;
}
