#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
inline void chmin(T1 &a, T2 b) {
  if (a > b) a = b;
}
template <typename T1, typename T2>
inline void chmax(T1 &a, T2 b) {
  if (a < b) a = b;
}
int main() {
  int n, m;
  cin >> n >> m;
  long long dp[100005];
  dp[0] = 1;
  dp[1] = 1;
  for (int i = 0; i < 100000; i++) dp[i + 2] = dp[i] + dp[i + 1];
  if (m != 0) {
    vector<int> a(m);
    for (int i = 0; i < m; i++) cin >> a[i];
    long long ans = 1;
    ans *= dp[a[0] - 1];
    if (m > 1) {
      for (int i = 0; i < m - 1; i++) {
        if (a[i + 1] == a[i] + 1)
          ans = 0;
        else
          ans *= dp[a[i + 1] - a[i] - 2] % 1000000007;
      }
    }
    ans *= dp[n - a[m - 1] - 1] % 1000000007;
    cout << ans << endl;
  } else
    cout << dp[m] % 1000000007 << endl;
}
