#include <functional>
#include <iostream>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include <numeric>
#include<string>
using ll = long long;
using namespace std;
# define maxn 100001 
# define maxm 100001

int main() {
  int n,m,a[maxn]={0};
  ll p[maxn]={0};
  cin>>n>>m;
  for (int i(0);i<m;i++){
    int ai;
    cin>>ai;
    a[ai]=1; // a[i]が１の時は子晴れている
  }
  //for (int i(1);i<=n;i++)cout <<a[i]<<endl;
  if (n==1){
    cout << 1;
    return 0;
  }else if(n==2){
    int ans= (a[1]==1)? 1:2;
    cout <<ans
    return 0;
  }
  if (a[1]==1&&a[2]==1){
    cout << 0;
    return 0;
  }else if(a[1]==1){
    p[1]=0;
    p[2]=1;
  }else if (a[2]==1){
    p[1]=1;
    p[2]=0;
  }else{
    p[1]=1;
    p[2]=2;
  }
  for (int i(3);i<=n;i++){
    if (a[i]==1) continue;
    if (a[i-1]==1&&a[i-2]==1){
      cout << 0;
      return 0;
    }else if (a[i-1]==1){
      p[i]=p[i-2]; 
    }else if (a[i-2]==1){
      p[i]=p[i-1]; 
    }else{
      p[i]=p[i-1]+p[i-2];
    }
  }
//  for (int i(1);i<=n;i++)cout <<p[i]<<endl;
  cout << p[n]%1000000007;
}
