#include <bits/stdc++.h>
using namespace std;
int ss(long int n) {
  if (n == 1)
    return 1;
  else if (n == 2)
    return 2;
  else
    return ss(n - 1) + ss(n - 2);
}
int main() {
  long int n, m;
  cin >> n >> m;
  long int a[m];
  long long int s = 1;
  for (int i = 0; i < m; i++) cin >> a[i];
  for (int j = 0; j < m + 1; j++) {
    long int k;
    if (j == 0) {
      k = a[0] - 1;
      if (k < 1) k = 1;
    } else if (j == m) {
      k = n - a[j - 1] - 1;
      if (k < 1) k - 1;
    } else {
      k = a[j] - a[j - 1] - 2;
      if (k < 0) {
        cout << 0 << endl;
        return 0;
      }
    }
    s *= ss(k);
  }
  cout << s % 1000000007 << endl;
  return 0;
}
