#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
long fib(int a) {
  long long ans = 1;
  if (a == 0 || a == 1)
    return ans;
  else
    return fib(a - 1) + fib(a - 2);
}
int main() {
  int n, m;
  int i = 0;
  long ans = 1;
  int tem = 0;
  cin >> n >> m;
  vector<int> a(m);
  while (i < m) {
    cin >> a[i++];
  }
  for (int p = 0; p < m; p++) {
    if (tem == a[p]) {
      ans = 0;
      break;
    }
    ans *= fib(a[p] - tem - 1);
    ans %= mod;
    tem = a[p] + 1;
  }
  ans *= fib(n - tem);
  ans %= mod;
  printf("%ld\n", ans);
  return 0;
}
