#include <bits/stdc++.h>
using namespace std;
const long long MOD = (long long)1e9 + 7;
int n, m, tmp, dp[100009];
bool brk[100009];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> tmp;
    brk[tmp] = true;
  }
  dp[1] = 1;
  dp[2] = 1;
  for (int i = 3; i <= n; i++) {
    dp[i] = dp[i - 2] + dp[i - 1];
    dp[i] = dp[i] % MOD;
  }
  long long ans = 1, cnt = 1;
  for (int i = 1; i <= n; i++) {
    if (brk[i]) {
      ans = ans * dp[cnt];
      ans = ans % MOD;
      cnt = 0;
    } else {
      cnt++;
    }
  }
  ans = ans * dp[cnt];
  ans = ans % MOD;
  cout << ans << "\n";
  return 0;
}
