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