#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int N;
  long long int M;
  cin >> N;
  cin >> M;
  long long int a[M + 2];
  a[0] = -1;
  a[M + 1] = N + 1;
  for (int i = 1; i < M + 1; i++) cin >> a[i];
  long long int fib[N + 1];
  fib[0] = 1;
  fib[1] = 1;
  for (int i = 2; i < N + 1; i++) {
    fib[i] = fib[i - 1] + fib[i - 2];
  }
  long long int patern = 1;
  long long int steps;
  for (int i = 1; i < M + 2; i++) {
    if ((a[i] - a[i - 1]) == 1) {
      patern = 0;
      break;
    } else {
      steps = a[i] - a[i - 1] - 2;
      patern *= fib[steps];
    }
  }
  cout << patern % 1000000007 << endl;
  return 0;
}
