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