const input=require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/);let input_i=-1;const tn=():number=>{input_i++;return Number(input[input_i])};const tnn=(n:number):number[]=>{const a=[];for(let i=0;i<n;i++){a.push(tn())}return a};const ts=():string=>{input_i++;return String(input[input_i])};const tss=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(ts())}return a};const to=(...arg)=>{console.log(...arg)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const floor=(a)=>{return Math.floor(a)};const asc=(ar:number[])=>{const t=[...ar];return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{const t=[...ar];return t.sort((a,b)=>{return b-a})};const sw=(a,arr:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<arr.length-1;i+=2){if(eval(a+op+arr[i])){return arr[i+1]}}return arr[arr.length-1]};const near=(n:number,arr:number[]):number=>{let ne=arr[0],ni=0;for(let i=1;i<arr.length;i++){if(Math.abs(n-ne)>Math.abs(n-arr[i])){ne=arr[i];ni=i}}return ni};const deduplicate=(a:any[]):any[]=>{return Array.from(new Set(a))};
const main=()=>{
  let [n,m]=tnn(2),mr=tnn(m),dp=new Array(n+1),x=1000000007
  dp[0]=1,dp[1]=1
  for(let j=0;j<mr.length-1;j++){
    if(mr[j]==mr[j+1]-1){
      to(0)
      return
    }
  }
  for(let i=2;i<=n;i++){
    let f=0
    for(let j=0;j<mr.length;j++){
      if(i==mr[j]){
        f=1
        dp[i]=dp[i-1]
        if(n>=i+1)dp[i+1]=dp[i-1]
        if(n>=i+2)dp[i+2]=dp[i-1]
        i+=2
        mr.pop()
        break
      }
    }
    if(!f)dp[i]=(dp[i-2]+dp[i-1])%x
  }
  to(dp[n])
}
main()
