#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int mod2 = 998244353;
long long fibonacci(long long n) {
  if (n == 0) return 1;
  if (n == 1) return 1;
  return (fibonacci(n - 1) + fibonacci(n - 2)) % mod;
}
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> a(m + 2);
  for (int i = (1); i < (m + 1); ++i) cin >> a[i];
  a[0] = -1;
  a[m + 1] = n + 1;
  long long ans = 1;
  for (int i = 0; i < (m + 1); ++i) {
    if (a[i + 1] - a[i] == 1) {
      ans *= 0;
      break;
    }
    ans *= fibonacci(a[i + 1] - a[i] - 2);
    ans %= mod;
  }
  cout << ans << endl;
}
