#include <bits/stdc++.h>
using namespace std;
int main(void) {
  unsigned long long list[10000];
  int n, m;
  cin >> n >> m;
  int *a = new int[m];
  for (int i = 0; i < m; i++) cin >> a[i];
  unsigned long long num = 1;
  list[0] = 1;
  list[1] = 1;
  list[2] = 2;
  for (int i = 3; i < n; i++) {
    list[i] = list[i - 1] + list[i - 2];
    list[i] = list[i] % 1000000007;
  }
  if (m == 0)
    num = list[n];
  else {
    num = list[a[0] - 1];
    for (int i = 1; i < m; i++) {
      if (a[i] - a[i - 1] == 1) num = 0;
      num *= list[a[i] - a[i - 1] - 2];
    }
    num *= list[n - a[m - 1] - 1];
  }
  cout << num % 1000000007;
  return 0;
}
