#include <iostream>

using namespace std;

int main()
{
  size_t n, m;
  cin >> n >> m;
  
  n += 1;
  vector<size_t> holes(m);
  for(size_t i = m-1; i >= 0; --i)
    cin >> holes[i];
  
  size_t section = 0;
  unsigned long long result = 1;
  vector<unsigned long long> steps(n);
  for(size_t i = 0; i < n; ++ i)
  {
    if(holes[holes.size()-1] == i)
    {
      holes.pop_back();        
      steps[i] = 0;
      result *= steps[i-1] % (unsigned long long)1000000007;
      
      if(!result)
        break;
        
      continue;
    }
    
    if(i < 2 || !steps[i-1] || !steps[i-2])
    {
    	steps[i] = 1;
      	continue;
    }
    
    steps[i] = steps[i-1] + steps[i-2];
  }
  result *= steps[steps.size() - 1] % (unsigned long long)1000000007;
  cout << result << endl;
  
  return 0;
}