import java.util.*;

public class Main{
    public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);

      int n=sc.nextInt();
      int m=sc.nextInt();

      int flag = 1;
      int ans = 0;

      int[] a = new int[m];
      for(int i=0;i<m;i++){
        a[i]=sc.nextInt()-1;
      }

      if(m>=2){
      //////////ERROR//////////////////////
      for(int i=0;i<m-1;i++){
        if(a[i+1]==a[i]+1){
          flag = 0;
          break;
        }
      }
      ////////////////////////////////////
      }

      //////////holl record///////////////
      int[] way = new int[n];
      int ccnt=0;
      for(int i=0;i<n;i++){
        for(int j=ccnt;j<m;j++){
          if(i==a[j]){
            way[i] = -1;
            ccnt++;
            break;
          }
        }
      }
      ////////////////////////////////////

      if(n==1){
        way[0] = 1;
      }
      else if(n==2){
        if(a.length==0){
          way[0] = 1;
          way[1] = 2;
        }
        else if(a.length==1){
          way[0] = 0;
          way[1] = 1;
        }
      }
      else if(n>=3){
        if(way[0]!=-1){
          way[0] = 1;
        }
        else{
          way[0] = 0;
        }

        if(way[1]!=-1){
          if(way[0]==0){
            way[1] = 1;
          }
          else if(way[0]==1){
            way[1] = 2;
          }
        }
        else if(way[1]==-1){
          way[1] = 0;
        }

        for(int i=2;i<n;i++){
          if(way[i]!=-1){
            way[i] = way[i-1] + way[i-2];
            way[i] = way[i] % 1000000007;
          }
          else{
            way[i] = 0;
          }
        }
      }

      ans = way[n-1] % 1000000007;

      if(flag==0){
        System.out.println("0");
      }
      else{
        System.out.println(ans);
      }

      for(int i=0;i<n;i++){
        //System.out.println("way["+i+"]="+way[i]);
      }
    }
} import java.util.*; util.* java public class Main{
    public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);

      int n=sc.nextInt();
      int m=sc.nextInt();

      int flag = 1;
      int ans = 0;

      int[] a = new int[m];
      for(int i=0;i<m;i++){
        a[i]=sc.nextInt()-1;
      }

      if(m>=2){
      //////////ERROR//////////////////////
      for(int i=0;i<m-1;i++){
        if(a[i+1]==a[i]+1){
          flag = 0;
          break;
        }
      }
      ////////////////////////////////////
      }

      //////////holl record///////////////
      int[] way = new int[n];
      int ccnt=0;
      for(int i=0;i<n;i++){
        for(int j=ccnt;j<m;j++){
          if(i==a[j]){
            way[i] = -1;
            ccnt++;
            break;
          }
        }
      }
      ////////////////////////////////////

      if(n==1){
        way[0] = 1;
      }
      else if(n==2){
        if(a.length==0){
          way[0] = 1;
          way[1] = 2;
        }
        else if(a.length==1){
          way[0] = 0;
          way[1] = 1;
        }
      }
      else if(n>=3){
        if(way[0]!=-1){
          way[0] = 1;
        }
        else{
          way[0] = 0;
        }

        if(way[1]!=-1){
          if(way[0]==0){
            way[1] = 1;
          }
          else if(way[0]==1){
            way[1] = 2;
          }
        }
        else if(way[1]==-1){
          way[1] = 0;
        }

        for(int i=2;i<n;i++){
          if(way[i]!=-1){
            way[i] = way[i-1] + way[i-2];
            way[i] = way[i] % 1000000007;
          }
          else{
            way[i] = 0;
          }
        }
      }

      ans = way[n-1] % 1000000007;

      if(flag==0){
        System.out.println("0");
      }
      else{
        System.out.println(ans);
      }

      for(int i=0;i<n;i++){
        //System.out.println("way["+i+"]="+way[i]);
      }
    }
} Main public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);

      int n=sc.nextInt();
      int m=sc.nextInt();

      int flag = 1;
      int ans = 0;

      int[] a = new int[m];
      for(int i=0;i<m;i++){
        a[i]=sc.nextInt()-1;
      }

      if(m>=2){
      //////////ERROR//////////////////////
      for(int i=0;i<m-1;i++){
        if(a[i+1]==a[i]+1){
          flag = 0;
          break;
        }
      }
      ////////////////////////////////////
      }

      //////////holl record///////////////
      int[] way = new int[n];
      int ccnt=0;
      for(int i=0;i<n;i++){
        for(int j=ccnt;j<m;j++){
          if(i==a[j]){
            way[i] = -1;
            ccnt++;
            break;
          }
        }
      }
      ////////////////////////////////////

      if(n==1){
        way[0] = 1;
      }
      else if(n==2){
        if(a.length==0){
          way[0] = 1;
          way[1] = 2;
        }
        else if(a.length==1){
          way[0] = 0;
          way[1] = 1;
        }
      }
      else if(n>=3){
        if(way[0]!=-1){
          way[0] = 1;
        }
        else{
          way[0] = 0;
        }

        if(way[1]!=-1){
          if(way[0]==0){
            way[1] = 1;
          }
          else if(way[0]==1){
            way[1] = 2;
          }
        }
        else if(way[1]==-1){
          way[1] = 0;
        }

        for(int i=2;i<n;i++){
          if(way[i]!=-1){
            way[i] = way[i-1] + way[i-2];
            way[i] = way[i] % 1000000007;
          }
          else{
            way[i] = 0;
          }
        }
      }

      ans = way[n-1] % 1000000007;

      if(flag==0){
        System.out.println("0");
      }
      else{
        System.out.println(ans);
      }

      for(int i=0;i<n;i++){
        //System.out.println("way["+i+"]="+way[i]);
      }
    } main {
      Scanner sc = new Scanner(System.in);

      int n=sc.nextInt();
      int m=sc.nextInt();

      int flag = 1;
      int ans = 0;

      int[] a = new int[m];
      for(int i=0;i<m;i++){
        a[i]=sc.nextInt()-1;
      }

      if(m>=2){
      //////////ERROR//////////////////////
      for(int i=0;i<m-1;i++){
        if(a[i+1]==a[i]+1){
          flag = 0;
          break;
        }
      }
      ////////////////////////////////////
      }

      //////////holl record///////////////
      int[] way = new int[n];
      int ccnt=0;
      for(int i=0;i<n;i++){
        for(int j=ccnt;j<m;j++){
          if(i==a[j]){
            way[i] = -1;
            ccnt++;
            break;
          }
        }
      }
      ////////////////////////////////////

      if(n==1){
        way[0] = 1;
      }
      else if(n==2){
        if(a.length==0){
          way[0] = 1;
          way[1] = 2;
        }
        else if(a.length==1){
          way[0] = 0;
          way[1] = 1;
        }
      }
      else if(n>=3){
        if(way[0]!=-1){
          way[0] = 1;
        }
        else{
          way[0] = 0;
        }

        if(way[1]!=-1){
          if(way[0]==0){
            way[1] = 1;
          }
          else if(way[0]==1){
            way[1] = 2;
          }
        }
        else if(way[1]==-1){
          way[1] = 0;
        }

        for(int i=2;i<n;i++){
          if(way[i]!=-1){
            way[i] = way[i-1] + way[i-2];
            way[i] = way[i] % 1000000007;
          }
          else{
            way[i] = 0;
          }
        }
      }

      ans = way[n-1] % 1000000007;

      if(flag==0){
        System.out.println("0");
      }
      else{
        System.out.println(ans);
      }

      for(int i=0;i<n;i++){
        //System.out.println("way["+i+"]="+way[i]);
      }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc int m=sc.nextInt(); m sc.nextInt() sc.nextInt sc int flag = 1; flag 1 int ans = 0; ans 0 int[] a = new int[m]; a new int[m] m for(int i=0;i<m;i++){
        a[i]=sc.nextInt()-1;
      } int i=0; int i=0; i 0 i<m i m i++ i++ i {
        a[i]=sc.nextInt()-1;
      } {
        a[i]=sc.nextInt()-1;
      } a[i]=sc.nextInt()-1 a[i] a i sc.nextInt()-1 sc.nextInt() sc.nextInt sc 1 if(m>=2){
      //////////ERROR//////////////////////
      for(int i=0;i<m-1;i++){
        if(a[i+1]==a[i]+1){
          flag = 0;
          break;
        }
      }
      ////////////////////////////////////
      } m>=2 m 2 {
      //////////ERROR//////////////////////
      for(int i=0;i<m-1;i++){
        if(a[i+1]==a[i]+1){
          flag = 0;
          break;
        }
      }
      ////////////////////////////////////
      } for(int i=0;i<m-1;i++){
        if(a[i+1]==a[i]+1){
          flag = 0;
          break;
        }
      } int i=0; int i=0; i 0 i<m-1 i m-1 m 1 i++ i++ i {
        if(a[i+1]==a[i]+1){
          flag = 0;
          break;
        }
      } {
        if(a[i+1]==a[i]+1){
          flag = 0;
          break;
        }
      } if(a[i+1]==a[i]+1){
          flag = 0;
          break;
        } a[i+1]==a[i]+1 a[i+1] a i+1 i 1 a[i]+1 a[i] a i 1 {
          flag = 0;
          break;
        } flag = 0 flag 0 break; int[] way = new int[n]; way new int[n] n int ccnt=0; ccnt 0 for(int i=0;i<n;i++){
        for(int j=ccnt;j<m;j++){
          if(i==a[j]){
            way[i] = -1;
            ccnt++;
            break;
          }
        }
      } int i=0; int i=0; i 0 i<n i n i++ i++ i {
        for(int j=ccnt;j<m;j++){
          if(i==a[j]){
            way[i] = -1;
            ccnt++;
            break;
          }
        }
      } {
        for(int j=ccnt;j<m;j++){
          if(i==a[j]){
            way[i] = -1;
            ccnt++;
            break;
          }
        }
      } for(int j=ccnt;j<m;j++){
          if(i==a[j]){
            way[i] = -1;
            ccnt++;
            break;
          }
        } int j=ccnt; int j=ccnt; j ccnt j<m j m j++ j++ j {
          if(i==a[j]){
            way[i] = -1;
            ccnt++;
            break;
          }
        } {
          if(i==a[j]){
            way[i] = -1;
            ccnt++;
            break;
          }
        } if(i==a[j]){
            way[i] = -1;
            ccnt++;
            break;
          } i==a[j] i a[j] a j {
            way[i] = -1;
            ccnt++;
            break;
          } way[i] = -1 way[i] way i -1 1 ccnt++ ccnt break; if(n==1){
        way[0] = 1;
      }
      else if(n==2){
        if(a.length==0){
          way[0] = 1;
          way[1] = 2;
        }
        else if(a.length==1){
          way[0] = 0;
          way[1] = 1;
        }
      }
      else if(n>=3){
        if(way[0]!=-1){
          way[0] = 1;
        }
        else{
          way[0] = 0;
        }

        if(way[1]!=-1){
          if(way[0]==0){
            way[1] = 1;
          }
          else if(way[0]==1){
            way[1] = 2;
          }
        }
        else if(way[1]==-1){
          way[1] = 0;
        }

        for(int i=2;i<n;i++){
          if(way[i]!=-1){
            way[i] = way[i-1] + way[i-2];
            way[i] = way[i] % 1000000007;
          }
          else{
            way[i] = 0;
          }
        }
      } n==1 n 1 {
        way[0] = 1;
      } way[0] = 1 way[0] way 0 1 if(n==2){
        if(a.length==0){
          way[0] = 1;
          way[1] = 2;
        }
        else if(a.length==1){
          way[0] = 0;
          way[1] = 1;
        }
      }
      else if(n>=3){
        if(way[0]!=-1){
          way[0] = 1;
        }
        else{
          way[0] = 0;
        }

        if(way[1]!=-1){
          if(way[0]==0){
            way[1] = 1;
          }
          else if(way[0]==1){
            way[1] = 2;
          }
        }
        else if(way[1]==-1){
          way[1] = 0;
        }

        for(int i=2;i<n;i++){
          if(way[i]!=-1){
            way[i] = way[i-1] + way[i-2];
            way[i] = way[i] % 1000000007;
          }
          else{
            way[i] = 0;
          }
        }
      } n==2 n 2 {
        if(a.length==0){
          way[0] = 1;
          way[1] = 2;
        }
        else if(a.length==1){
          way[0] = 0;
          way[1] = 1;
        }
      } if(a.length==0){
          way[0] = 1;
          way[1] = 2;
        }
        else if(a.length==1){
          way[0] = 0;
          way[1] = 1;
        } a.length==0 a.length a a.length 0 {
          way[0] = 1;
          way[1] = 2;
        } way[0] = 1 way[0] way 0 1 way[1] = 2 way[1] way 1 2 if(a.length==1){
          way[0] = 0;
          way[1] = 1;
        } a.length==1 a.length a a.length 1 {
          way[0] = 0;
          way[1] = 1;
        } way[0] = 0 way[0] way 0 0 way[1] = 1 way[1] way 1 1 if(n>=3){
        if(way[0]!=-1){
          way[0] = 1;
        }
        else{
          way[0] = 0;
        }

        if(way[1]!=-1){
          if(way[0]==0){
            way[1] = 1;
          }
          else if(way[0]==1){
            way[1] = 2;
          }
        }
        else if(way[1]==-1){
          way[1] = 0;
        }

        for(int i=2;i<n;i++){
          if(way[i]!=-1){
            way[i] = way[i-1] + way[i-2];
            way[i] = way[i] % 1000000007;
          }
          else{
            way[i] = 0;
          }
        }
      } n>=3 n 3 {
        if(way[0]!=-1){
          way[0] = 1;
        }
        else{
          way[0] = 0;
        }

        if(way[1]!=-1){
          if(way[0]==0){
            way[1] = 1;
          }
          else if(way[0]==1){
            way[1] = 2;
          }
        }
        else if(way[1]==-1){
          way[1] = 0;
        }

        for(int i=2;i<n;i++){
          if(way[i]!=-1){
            way[i] = way[i-1] + way[i-2];
            way[i] = way[i] % 1000000007;
          }
          else{
            way[i] = 0;
          }
        }
      } if(way[0]!=-1){
          way[0] = 1;
        }
        else{
          way[0] = 0;
        } way[0]!=-1 way[0] way 0 -1 1 {
          way[0] = 1;
        } way[0] = 1 way[0] way 0 1 {
          way[0] = 0;
        } way[0] = 0 way[0] way 0 0 if(way[1]!=-1){
          if(way[0]==0){
            way[1] = 1;
          }
          else if(way[0]==1){
            way[1] = 2;
          }
        }
        else if(way[1]==-1){
          way[1] = 0;
        } way[1]!=-1 way[1] way 1 -1 1 {
          if(way[0]==0){
            way[1] = 1;
          }
          else if(way[0]==1){
            way[1] = 2;
          }
        } if(way[0]==0){
            way[1] = 1;
          }
          else if(way[0]==1){
            way[1] = 2;
          } way[0]==0 way[0] way 0 0 {
            way[1] = 1;
          } way[1] = 1 way[1] way 1 1 if(way[0]==1){
            way[1] = 2;
          } way[0]==1 way[0] way 0 1 {
            way[1] = 2;
          } way[1] = 2 way[1] way 1 2 if(way[1]==-1){
          way[1] = 0;
        } way[1]==-1 way[1] way 1 -1 1 {
          way[1] = 0;
        } way[1] = 0 way[1] way 1 0 for(int i=2;i<n;i++){
          if(way[i]!=-1){
            way[i] = way[i-1] + way[i-2];
            way[i] = way[i] % 1000000007;
          }
          else{
            way[i] = 0;
          }
        } int i=2; int i=2; i 2 i<n i n i++ i++ i {
          if(way[i]!=-1){
            way[i] = way[i-1] + way[i-2];
            way[i] = way[i] % 1000000007;
          }
          else{
            way[i] = 0;
          }
        } {
          if(way[i]!=-1){
            way[i] = way[i-1] + way[i-2];
            way[i] = way[i] % 1000000007;
          }
          else{
            way[i] = 0;
          }
        } if(way[i]!=-1){
            way[i] = way[i-1] + way[i-2];
            way[i] = way[i] % 1000000007;
          }
          else{
            way[i] = 0;
          } way[i]!=-1 way[i] way i -1 1 {
            way[i] = way[i-1] + way[i-2];
            way[i] = way[i] % 1000000007;
          } way[i] = way[i-1] + way[i-2] way[i] way i way[i-1] + way[i-2] way[i-1] way i-1 i 1 way[i-2] way i-2 i 2 way[i] = way[i] % 1000000007 way[i] way i way[i] % 1000000007 way[i] way i 1000000007 {
            way[i] = 0;
          } way[i] = 0 way[i] way i 0 ans = way[n-1] % 1000000007 ans way[n-1] % 1000000007 way[n-1] way n-1 n 1 1000000007 if(flag==0){
        System.out.println("0");
      }
      else{
        System.out.println(ans);
      } flag==0 flag 0 {
        System.out.println("0");
      } System.out.println("0") System.out.println System.out System System.out "0" {
        System.out.println(ans);
      } System.out.println(ans) System.out.println System.out System System.out ans for(int i=0;i<n;i++){
        //System.out.println("way["+i+"]="+way[i]);
      } int i=0; int i=0; i 0 i<n i n i++ i++ i {
        //System.out.println("way["+i+"]="+way[i]);
      } {
        //System.out.println("way["+i+"]="+way[i]);
      } String[] args args public class Main{
    public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);

      int n=sc.nextInt();
      int m=sc.nextInt();

      int flag = 1;
      int ans = 0;

      int[] a = new int[m];
      for(int i=0;i<m;i++){
        a[i]=sc.nextInt()-1;
      }

      if(m>=2){
      //////////ERROR//////////////////////
      for(int i=0;i<m-1;i++){
        if(a[i+1]==a[i]+1){
          flag = 0;
          break;
        }
      }
      ////////////////////////////////////
      }

      //////////holl record///////////////
      int[] way = new int[n];
      int ccnt=0;
      for(int i=0;i<n;i++){
        for(int j=ccnt;j<m;j++){
          if(i==a[j]){
            way[i] = -1;
            ccnt++;
            break;
          }
        }
      }
      ////////////////////////////////////

      if(n==1){
        way[0] = 1;
      }
      else if(n==2){
        if(a.length==0){
          way[0] = 1;
          way[1] = 2;
        }
        else if(a.length==1){
          way[0] = 0;
          way[1] = 1;
        }
      }
      else if(n>=3){
        if(way[0]!=-1){
          way[0] = 1;
        }
        else{
          way[0] = 0;
        }

        if(way[1]!=-1){
          if(way[0]==0){
            way[1] = 1;
          }
          else if(way[0]==1){
            way[1] = 2;
          }
        }
        else if(way[1]==-1){
          way[1] = 0;
        }

        for(int i=2;i<n;i++){
          if(way[i]!=-1){
            way[i] = way[i-1] + way[i-2];
            way[i] = way[i] % 1000000007;
          }
          else{
            way[i] = 0;
          }
        }
      }

      ans = way[n-1] % 1000000007;

      if(flag==0){
        System.out.println("0");
      }
      else{
        System.out.println(ans);
      }

      for(int i=0;i<n;i++){
        //System.out.println("way["+i+"]="+way[i]);
      }
    }
} public class Main{
    public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);

      int n=sc.nextInt();
      int m=sc.nextInt();

      int flag = 1;
      int ans = 0;

      int[] a = new int[m];
      for(int i=0;i<m;i++){
        a[i]=sc.nextInt()-1;
      }

      if(m>=2){
      //////////ERROR//////////////////////
      for(int i=0;i<m-1;i++){
        if(a[i+1]==a[i]+1){
          flag = 0;
          break;
        }
      }
      ////////////////////////////////////
      }

      //////////holl record///////////////
      int[] way = new int[n];
      int ccnt=0;
      for(int i=0;i<n;i++){
        for(int j=ccnt;j<m;j++){
          if(i==a[j]){
            way[i] = -1;
            ccnt++;
            break;
          }
        }
      }
      ////////////////////////////////////

      if(n==1){
        way[0] = 1;
      }
      else if(n==2){
        if(a.length==0){
          way[0] = 1;
          way[1] = 2;
        }
        else if(a.length==1){
          way[0] = 0;
          way[1] = 1;
        }
      }
      else if(n>=3){
        if(way[0]!=-1){
          way[0] = 1;
        }
        else{
          way[0] = 0;
        }

        if(way[1]!=-1){
          if(way[0]==0){
            way[1] = 1;
          }
          else if(way[0]==1){
            way[1] = 2;
          }
        }
        else if(way[1]==-1){
          way[1] = 0;
        }

        for(int i=2;i<n;i++){
          if(way[i]!=-1){
            way[i] = way[i-1] + way[i-2];
            way[i] = way[i] % 1000000007;
          }
          else{
            way[i] = 0;
          }
        }
      }

      ans = way[n-1] % 1000000007;

      if(flag==0){
        System.out.println("0");
      }
      else{
        System.out.println(ans);
      }

      for(int i=0;i<n;i++){
        //System.out.println("way["+i+"]="+way[i]);
      }
    }
} Main
import java.util.*;

public class Main{
    public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);

      int n=sc.nextInt();
      int m=sc.nextInt();

      int flag = 1;
      int ans = 0;

      int[] a = new int[m];
      for(int i=0;i<m;i++){
        a[i]=sc.nextInt()-1;
      }

      if(m>=2){
      //////////ERROR//////////////////////
      for(int i=0;i<m-1;i++){
        if(a[i+1]==a[i]+1){
          flag = 0;
          break;
        }
      }
      ////////////////////////////////////
      }

      //////////holl record///////////////
      int[] way = new int[n];
      int ccnt=0;
      for(int i=0;i<n;i++){
        for(int j=ccnt;j<m;j++){
          if(i==a[j]){
            way[i] = -1;
            ccnt++;
            break;
          }
        }
      }
      ////////////////////////////////////

      if(n==1){
        way[0] = 1;
      }
      else if(n==2){
        if(a.length==0){
          way[0] = 1;
          way[1] = 2;
        }
        else if(a.length==1){
          way[0] = 0;
          way[1] = 1;
        }
      }
      else if(n>=3){
        if(way[0]!=-1){
          way[0] = 1;
        }
        else{
          way[0] = 0;
        }

        if(way[1]!=-1){
          if(way[0]==0){
            way[1] = 1;
          }
          else if(way[0]==1){
            way[1] = 2;
          }
        }
        else if(way[1]==-1){
          way[1] = 0;
        }

        for(int i=2;i<n;i++){
          if(way[i]!=-1){
            way[i] = way[i-1] + way[i-2];
            way[i] = way[i] % 1000000007;
          }
          else{
            way[i] = 0;
          }
        }
      }

      ans = way[n-1] % 1000000007;

      if(flag==0){
        System.out.println("0");
      }
      else{
        System.out.println(ans);
      }

      for(int i=0;i<n;i++){
        //System.out.println("way["+i+"]="+way[i]);
      }
    }
}
