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