#include <bits/stdc++.h>
using namespace std;
const unsigned long long mod = 1e9 + 7;
unsigned long long fibonacci(int n) {
  if (n <= 0) {
    return 0;
  }
  unsigned long long n1 = 1;
  unsigned long long n2 = 1;
  for (int i = 0; i < n - 2; i++) {
    unsigned long long tmp = n1;
    n1 = n1 + n2;
    n2 = tmp;
  }
  return n1;
}
int main(int argc, char *argv[]) {
  int n, m;
  cin >> n >> m;
  int a[m];
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  unsigned long long ways = 1;
  int current = 0;
  int prev_a = -1;
  for (int i = 0; i < m; i++) {
    if (a[i] - 1 == prev_a) {
      ways = 0;
      break;
    }
    ways *= fibonacci((a[i] - 1) - current + 1);
    current = a[i] + 1;
    prev_a = a[i];
  }
  ways *= fibonacci(n - current + 1);
  ways %= mod;
  cout << ways << endl;
}
