#include <bits/stdc++.h>
using namespace std;
long long n, m, a[100009];
long long sendai = 0;
long long ans = 1;
bool bad;
long long fibo(long long y) {
  long long one = 0;
  long long two = 1;
  if (y == 0) return 1;
  for (int i = 0; i < y; i++) {
    long long tmp = one;
    one = two;
    two += tmp;
  }
  return two;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    if (a[i] >= 1 && a[i - 1] + 1 == a[i]) {
      bad = true;
      cout << 0 << endl;
      break;
    }
  }
  if (bad == false) {
    for (int ppap = 0; ppap < m; ppap++) {
      ans *= fibo(a[ppap] - (sendai + 1));
      sendai = a[ppap];
      ans %= 1000000007;
      if (ans == 0) ans = 1;
    }
    ans *= fibo(n - (sendai));
    ans %= 1000000007;
    if (ans == 0) ans = 1;
    cout << ans << endl;
  }
}
