#include <bits/stdc++.h>
using namespace std;
int dp[100000];
int fibo(int n) {
  if (n == 1 || n == 0) return dp[n] = 1;
  if (dp[n] != -1) return dp[n];
  return dp[n] = fibo(n - 1) + fibo(n - 2);
}
int main() {
  long long n, m;
  cin >> n >> m;
  for (int i = 0; i < 100000; ++i) dp[i] = -1;
  if (1 == n) {
    cout << 1 << endl;
    return 0;
  }
  if (m == 0) {
    cout << fibo(n) << endl;
    return 0;
  }
  long long ans = 1;
  long long foo = 1;
  for (int i = 0; i < m; ++i) {
    long long fooo;
    cin >> fooo;
    foo = fooo - foo;
    if (i) {
      ans *= fibo(foo - 2);
    } else {
      ans *= fibo(foo);
    }
    if (foo == 1) ans = 0;
    ans %= 1000000007;
    foo = fooo;
  }
  ans *= fibo(n - foo - 1);
  ans %= 1000000007;
  cout << ans << endl;
  return 0;
}
