#include <bits/stdc++.h>
using namespace std;
long long dp[10000001];
int main() {
  int N, M;
  vector<int> a;
  cin >> N >> M;
  a.push_back(0);
  for (int i = 0; i < M; i++) {
    int t;
    cin >> t;
    a.push_back(t);
  }
  a.push_back(N);
  dp[0] = 1;
  dp[1] = 1;
  for (int i = 2; i <= N; i++) {
    dp[i] = ((dp[i - 1]) % 1000000007 + (dp[i - 2]) % 1000000007) % 1000000007;
  }
  long long ans = 1;
  for (int i = 1; i <= a.size() - 1; i++) {
    if (a[i - 1] > 0 && a[i] - a[i - 1] <= 1) {
      cout << "0a" << endl;
      return 0;
    }
    if (i == 1 || i == a.size() - 1) {
      ans = ans * dp[a[i] - a[i - 1] - 1] % 1000000007;
    } else {
      ans = ans * dp[a[i] - a[i - 1] - 2] % 1000000007;
    }
  }
  cout << ans % 1000000007 << endl;
  return 0;
}
