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