#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  int n, m;
  cin >> n >> m;
  vector<int> a;
  for (int i = 0; i < m; i++) {
    int ai;
    cin >> ai;
    a.push_back(ai);
  }
  int prev = 1;
  int ans = 1;
  if (2 <= m) {
    int prev_broken_index = a[0];
    for (int i = 1; i < m; i++) {
      if (prev_broken_index + 1 == a[i]) {
        cout << "0" << endl;
        return 0;
      }
    }
  }
  int m_index = 0;
  for (int i = 0; i < n;) {
    if (m != 0 && i + 1 == a[m_index]) {
      if (m_index < m - 1) {
        m_index++;
      }
      ans = ans;
      prev = 0;
      i += 2;
    } else if (m != 0 && i + 2 == a[m_index]) {
      int next_ans = (prev + ans) % 1000000007;
      prev = ans;
      ans = next_ans;
      i++;
    } else {
      int next_ans = (prev + ans) % 1000000007;
      prev = ans;
      ans = next_ans;
      i++;
    }
  }
  cout << ans << endl;
  return 0;
}
