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