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