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