#include <bits/stdc++.h>
using namespace std;
long long fibonacci(float n);
int main() {
  int N, M;
  cin >> N >> M;
  int prev_trap = -1;
  int next_trap;
  int safe_stairs_count;
  long long ans = 1;
  int mod = 1000000007;
  while (cin >> next_trap) {
    safe_stairs_count = (next_trap - 1) - (prev_trap + 1) + 1;
    if (!safe_stairs_count > 0) {
      cout << 0 << endl;
      return 0;
    }
    ans *= fibonacci(safe_stairs_count);
    ans %= mod;
    prev_trap = next_trap;
  }
  next_trap = N + 1;
  safe_stairs_count = (next_trap - 1) - (prev_trap + 1) + 1;
  if (!safe_stairs_count > 0) {
    cout << 0 << endl;
    return 0;
  }
  ans *= fibonacci(safe_stairs_count);
  ans %= mod;
  prev_trap = next_trap;
  cout << ans << endl;
}
long long fibonacci(float n) {
  float sqrt_5 = sqrtf(5.0f);
  return (powf(((1.0f + sqrt_5) * 0.5f), n) -
          powf(((1.0f - sqrt_5) * 0.5f), n)) /
         sqrt_5;
}
