#include <bits/stdc++.h>
using namespace std;
long fb(int x) {
  long s = 0;
  long t = 1;
  long tmp = 0;
  for (int i = 1; i < x; i++) {
    tmp = t;
    t = s + t;
    s = tmp;
    if (t > 100000007) t % 100000007;
  }
  return t;
}
int main() {
  int n, m;
  cin >> n >> m;
  long ans = 0;
  int a[m];
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    if (a[0] != 1 && a[i - 1] + 1 == a[i]) {
      cout << "0\n";
      return 0;
      exit;
    }
  }
  ans = fb(a[0]);
  for (int i = 1; i < m; i++) {
    ans = ans * fb(a[i] - a[i - 1] - 1);
    if (ans > 1000000006) ans = ans % 1000000007;
  }
  ans = ans * fb(n - a[m - 1]);
  if (ans > 1000000006) ans = ans % 1000000007;
  cout << ans << "\n";
  return 0;
}
