import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int[] broken = new int[m];
    for(int i = 0; i < m; i++){
      broken[i] = Integer.parseInt(sc.next());
    }

    boolean possible = true;
    int succesive_safe = 1;
    int succesive_broken = 0;
    Long total_way = 1L;
    int[] fibonatti = {0,0,1};
    int next_broken = 0;

    for(int i = 0; i < n; i++){
      if(m != 0){
        if(i + 1 != broken[next_broken]){
          if(succesive_safe == 0){
            succesive_broken = 0; 
          }
          succesive_safe++;
          
          fibonatti[0] = fibonatti[1];
          fibonatti[1] = fibonatti[2];
          fibonatti[2] = (fibonatti[1] + fibonatti[0]) % 1000000007;
          if(succesive_safe == 1){
            fibonatti[2] = 1;
          }
        }else if(succesive_broken == 0){
          succesive_broken++;
          total_way = total_way * fibonatti[2] % 1000000007;
          succesive_safe = 0;
          fibonatti[0] = 0;
          fibonatti[1] = 0;
          fibonatti[2] = 0;
          if(next_broken != m - 1){
            next_broken++;
          }
        }else{
          possible = false;
          break;
        }
      }else{
        succesive_safe++;
          
        fibonatti[0] = fibonatti[1];
        fibonatti[1] = fibonatti[2];
        fibonatti[2] = (fibonatti[1] + fibonatti[0]) % 1000000007;
      }
    }
    total_way = total_way * fibonatti[2] % 1000000007;
    if(possible){
      System.out.println(total_way);
    }else{
      System.out.println(0);
    }
  }
} import java.util.Scanner; Scanner java.util class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int[] broken = new int[m];
    for(int i = 0; i < m; i++){
      broken[i] = Integer.parseInt(sc.next());
    }

    boolean possible = true;
    int succesive_safe = 1;
    int succesive_broken = 0;
    Long total_way = 1L;
    int[] fibonatti = {0,0,1};
    int next_broken = 0;

    for(int i = 0; i < n; i++){
      if(m != 0){
        if(i + 1 != broken[next_broken]){
          if(succesive_safe == 0){
            succesive_broken = 0; 
          }
          succesive_safe++;
          
          fibonatti[0] = fibonatti[1];
          fibonatti[1] = fibonatti[2];
          fibonatti[2] = (fibonatti[1] + fibonatti[0]) % 1000000007;
          if(succesive_safe == 1){
            fibonatti[2] = 1;
          }
        }else if(succesive_broken == 0){
          succesive_broken++;
          total_way = total_way * fibonatti[2] % 1000000007;
          succesive_safe = 0;
          fibonatti[0] = 0;
          fibonatti[1] = 0;
          fibonatti[2] = 0;
          if(next_broken != m - 1){
            next_broken++;
          }
        }else{
          possible = false;
          break;
        }
      }else{
        succesive_safe++;
          
        fibonatti[0] = fibonatti[1];
        fibonatti[1] = fibonatti[2];
        fibonatti[2] = (fibonatti[1] + fibonatti[0]) % 1000000007;
      }
    }
    total_way = total_way * fibonatti[2] % 1000000007;
    if(possible){
      System.out.println(total_way);
    }else{
      System.out.println(0);
    }
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int[] broken = new int[m];
    for(int i = 0; i < m; i++){
      broken[i] = Integer.parseInt(sc.next());
    }

    boolean possible = true;
    int succesive_safe = 1;
    int succesive_broken = 0;
    Long total_way = 1L;
    int[] fibonatti = {0,0,1};
    int next_broken = 0;

    for(int i = 0; i < n; i++){
      if(m != 0){
        if(i + 1 != broken[next_broken]){
          if(succesive_safe == 0){
            succesive_broken = 0; 
          }
          succesive_safe++;
          
          fibonatti[0] = fibonatti[1];
          fibonatti[1] = fibonatti[2];
          fibonatti[2] = (fibonatti[1] + fibonatti[0]) % 1000000007;
          if(succesive_safe == 1){
            fibonatti[2] = 1;
          }
        }else if(succesive_broken == 0){
          succesive_broken++;
          total_way = total_way * fibonatti[2] % 1000000007;
          succesive_safe = 0;
          fibonatti[0] = 0;
          fibonatti[1] = 0;
          fibonatti[2] = 0;
          if(next_broken != m - 1){
            next_broken++;
          }
        }else{
          possible = false;
          break;
        }
      }else{
        succesive_safe++;
          
        fibonatti[0] = fibonatti[1];
        fibonatti[1] = fibonatti[2];
        fibonatti[2] = (fibonatti[1] + fibonatti[0]) % 1000000007;
      }
    }
    total_way = total_way * fibonatti[2] % 1000000007;
    if(possible){
      System.out.println(total_way);
    }else{
      System.out.println(0);
    }
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int[] broken = new int[m];
    for(int i = 0; i < m; i++){
      broken[i] = Integer.parseInt(sc.next());
    }

    boolean possible = true;
    int succesive_safe = 1;
    int succesive_broken = 0;
    Long total_way = 1L;
    int[] fibonatti = {0,0,1};
    int next_broken = 0;

    for(int i = 0; i < n; i++){
      if(m != 0){
        if(i + 1 != broken[next_broken]){
          if(succesive_safe == 0){
            succesive_broken = 0; 
          }
          succesive_safe++;
          
          fibonatti[0] = fibonatti[1];
          fibonatti[1] = fibonatti[2];
          fibonatti[2] = (fibonatti[1] + fibonatti[0]) % 1000000007;
          if(succesive_safe == 1){
            fibonatti[2] = 1;
          }
        }else if(succesive_broken == 0){
          succesive_broken++;
          total_way = total_way * fibonatti[2] % 1000000007;
          succesive_safe = 0;
          fibonatti[0] = 0;
          fibonatti[1] = 0;
          fibonatti[2] = 0;
          if(next_broken != m - 1){
            next_broken++;
          }
        }else{
          possible = false;
          break;
        }
      }else{
        succesive_safe++;
          
        fibonatti[0] = fibonatti[1];
        fibonatti[1] = fibonatti[2];
        fibonatti[2] = (fibonatti[1] + fibonatti[0]) % 1000000007;
      }
    }
    total_way = total_way * fibonatti[2] % 1000000007;
    if(possible){
      System.out.println(total_way);
    }else{
      System.out.println(0);
    }
  } 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[] broken = new int[m]; broken new int[m] m for(int i = 0; i < m; i++){
      broken[i] = Integer.parseInt(sc.next());
    } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
      broken[i] = Integer.parseInt(sc.next());
    } {
      broken[i] = Integer.parseInt(sc.next());
    } broken[i] = Integer.parseInt(sc.next()) broken[i] broken i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc boolean possible = true; possible true int succesive_safe = 1; succesive_safe 1 int succesive_broken = 0; succesive_broken 0 Long total_way = 1L; total_way 1L int[] fibonatti = {0,0,1}; fibonatti {0,0,1} 0 0 1 int next_broken = 0; next_broken 0 for(int i = 0; i < n; i++){
      if(m != 0){
        if(i + 1 != broken[next_broken]){
          if(succesive_safe == 0){
            succesive_broken = 0; 
          }
          succesive_safe++;
          
          fibonatti[0] = fibonatti[1];
          fibonatti[1] = fibonatti[2];
          fibonatti[2] = (fibonatti[1] + fibonatti[0]) % 1000000007;
          if(succesive_safe == 1){
            fibonatti[2] = 1;
          }
        }else if(succesive_broken == 0){
          succesive_broken++;
          total_way = total_way * fibonatti[2] % 1000000007;
          succesive_safe = 0;
          fibonatti[0] = 0;
          fibonatti[1] = 0;
          fibonatti[2] = 0;
          if(next_broken != m - 1){
            next_broken++;
          }
        }else{
          possible = false;
          break;
        }
      }else{
        succesive_safe++;
          
        fibonatti[0] = fibonatti[1];
        fibonatti[1] = fibonatti[2];
        fibonatti[2] = (fibonatti[1] + fibonatti[0]) % 1000000007;
      }
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      if(m != 0){
        if(i + 1 != broken[next_broken]){
          if(succesive_safe == 0){
            succesive_broken = 0; 
          }
          succesive_safe++;
          
          fibonatti[0] = fibonatti[1];
          fibonatti[1] = fibonatti[2];
          fibonatti[2] = (fibonatti[1] + fibonatti[0]) % 1000000007;
          if(succesive_safe == 1){
            fibonatti[2] = 1;
          }
        }else if(succesive_broken == 0){
          succesive_broken++;
          total_way = total_way * fibonatti[2] % 1000000007;
          succesive_safe = 0;
          fibonatti[0] = 0;
          fibonatti[1] = 0;
          fibonatti[2] = 0;
          if(next_broken != m - 1){
            next_broken++;
          }
        }else{
          possible = false;
          break;
        }
      }else{
        succesive_safe++;
          
        fibonatti[0] = fibonatti[1];
        fibonatti[1] = fibonatti[2];
        fibonatti[2] = (fibonatti[1] + fibonatti[0]) % 1000000007;
      }
    } {
      if(m != 0){
        if(i + 1 != broken[next_broken]){
          if(succesive_safe == 0){
            succesive_broken = 0; 
          }
          succesive_safe++;
          
          fibonatti[0] = fibonatti[1];
          fibonatti[1] = fibonatti[2];
          fibonatti[2] = (fibonatti[1] + fibonatti[0]) % 1000000007;
          if(succesive_safe == 1){
            fibonatti[2] = 1;
          }
        }else if(succesive_broken == 0){
          succesive_broken++;
          total_way = total_way * fibonatti[2] % 1000000007;
          succesive_safe = 0;
          fibonatti[0] = 0;
          fibonatti[1] = 0;
          fibonatti[2] = 0;
          if(next_broken != m - 1){
            next_broken++;
          }
        }else{
          possible = false;
          break;
        }
      }else{
        succesive_safe++;
          
        fibonatti[0] = fibonatti[1];
        fibonatti[1] = fibonatti[2];
        fibonatti[2] = (fibonatti[1] + fibonatti[0]) % 1000000007;
      }
    } if(m != 0){
        if(i + 1 != broken[next_broken]){
          if(succesive_safe == 0){
            succesive_broken = 0; 
          }
          succesive_safe++;
          
          fibonatti[0] = fibonatti[1];
          fibonatti[1] = fibonatti[2];
          fibonatti[2] = (fibonatti[1] + fibonatti[0]) % 1000000007;
          if(succesive_safe == 1){
            fibonatti[2] = 1;
          }
        }else if(succesive_broken == 0){
          succesive_broken++;
          total_way = total_way * fibonatti[2] % 1000000007;
          succesive_safe = 0;
          fibonatti[0] = 0;
          fibonatti[1] = 0;
          fibonatti[2] = 0;
          if(next_broken != m - 1){
            next_broken++;
          }
        }else{
          possible = false;
          break;
        }
      }else{
        succesive_safe++;
          
        fibonatti[0] = fibonatti[1];
        fibonatti[1] = fibonatti[2];
        fibonatti[2] = (fibonatti[1] + fibonatti[0]) % 1000000007;
      } m != 0 m 0 {
        if(i + 1 != broken[next_broken]){
          if(succesive_safe == 0){
            succesive_broken = 0; 
          }
          succesive_safe++;
          
          fibonatti[0] = fibonatti[1];
          fibonatti[1] = fibonatti[2];
          fibonatti[2] = (fibonatti[1] + fibonatti[0]) % 1000000007;
          if(succesive_safe == 1){
            fibonatti[2] = 1;
          }
        }else if(succesive_broken == 0){
          succesive_broken++;
          total_way = total_way * fibonatti[2] % 1000000007;
          succesive_safe = 0;
          fibonatti[0] = 0;
          fibonatti[1] = 0;
          fibonatti[2] = 0;
          if(next_broken != m - 1){
            next_broken++;
          }
        }else{
          possible = false;
          break;
        }
      } if(i + 1 != broken[next_broken]){
          if(succesive_safe == 0){
            succesive_broken = 0; 
          }
          succesive_safe++;
          
          fibonatti[0] = fibonatti[1];
          fibonatti[1] = fibonatti[2];
          fibonatti[2] = (fibonatti[1] + fibonatti[0]) % 1000000007;
          if(succesive_safe == 1){
            fibonatti[2] = 1;
          }
        }else if(succesive_broken == 0){
          succesive_broken++;
          total_way = total_way * fibonatti[2] % 1000000007;
          succesive_safe = 0;
          fibonatti[0] = 0;
          fibonatti[1] = 0;
          fibonatti[2] = 0;
          if(next_broken != m - 1){
            next_broken++;
          }
        }else{
          possible = false;
          break;
        } i + 1 != broken[next_broken] i + 1 i 1 broken[next_broken] broken next_broken {
          if(succesive_safe == 0){
            succesive_broken = 0; 
          }
          succesive_safe++;
          
          fibonatti[0] = fibonatti[1];
          fibonatti[1] = fibonatti[2];
          fibonatti[2] = (fibonatti[1] + fibonatti[0]) % 1000000007;
          if(succesive_safe == 1){
            fibonatti[2] = 1;
          }
        } if(succesive_safe == 0){
            succesive_broken = 0; 
          } succesive_safe == 0 succesive_safe 0 {
            succesive_broken = 0; 
          } succesive_broken = 0 succesive_broken 0 succesive_safe++ succesive_safe fibonatti[0] = fibonatti[1] fibonatti[0] fibonatti 0 fibonatti[1] fibonatti 1 fibonatti[1] = fibonatti[2] fibonatti[1] fibonatti 1 fibonatti[2] fibonatti 2 fibonatti[2] = (fibonatti[1] + fibonatti[0]) % 1000000007 fibonatti[2] fibonatti 2 (fibonatti[1] + fibonatti[0]) % 1000000007 (fibonatti[1] + fibonatti[0]) fibonatti[1] fibonatti 1 fibonatti[0] fibonatti 0 1000000007 if(succesive_safe == 1){
            fibonatti[2] = 1;
          } succesive_safe == 1 succesive_safe 1 {
            fibonatti[2] = 1;
          } fibonatti[2] = 1 fibonatti[2] fibonatti 2 1 if(succesive_broken == 0){
          succesive_broken++;
          total_way = total_way * fibonatti[2] % 1000000007;
          succesive_safe = 0;
          fibonatti[0] = 0;
          fibonatti[1] = 0;
          fibonatti[2] = 0;
          if(next_broken != m - 1){
            next_broken++;
          }
        }else{
          possible = false;
          break;
        } succesive_broken == 0 succesive_broken 0 {
          succesive_broken++;
          total_way = total_way * fibonatti[2] % 1000000007;
          succesive_safe = 0;
          fibonatti[0] = 0;
          fibonatti[1] = 0;
          fibonatti[2] = 0;
          if(next_broken != m - 1){
            next_broken++;
          }
        } succesive_broken++ succesive_broken total_way = total_way * fibonatti[2] % 1000000007 total_way total_way * fibonatti[2] % 1000000007 total_way * fibonatti[2] total_way fibonatti[2] fibonatti 2 1000000007 succesive_safe = 0 succesive_safe 0 fibonatti[0] = 0 fibonatti[0] fibonatti 0 0 fibonatti[1] = 0 fibonatti[1] fibonatti 1 0 fibonatti[2] = 0 fibonatti[2] fibonatti 2 0 if(next_broken != m - 1){
            next_broken++;
          } next_broken != m - 1 next_broken m - 1 m 1 {
            next_broken++;
          } next_broken++ next_broken {
          possible = false;
          break;
        } possible = false possible false break; {
        succesive_safe++;
          
        fibonatti[0] = fibonatti[1];
        fibonatti[1] = fibonatti[2];
        fibonatti[2] = (fibonatti[1] + fibonatti[0]) % 1000000007;
      } succesive_safe++ succesive_safe fibonatti[0] = fibonatti[1] fibonatti[0] fibonatti 0 fibonatti[1] fibonatti 1 fibonatti[1] = fibonatti[2] fibonatti[1] fibonatti 1 fibonatti[2] fibonatti 2 fibonatti[2] = (fibonatti[1] + fibonatti[0]) % 1000000007 fibonatti[2] fibonatti 2 (fibonatti[1] + fibonatti[0]) % 1000000007 (fibonatti[1] + fibonatti[0]) fibonatti[1] fibonatti 1 fibonatti[0] fibonatti 0 1000000007 total_way = total_way * fibonatti[2] % 1000000007 total_way total_way * fibonatti[2] % 1000000007 total_way * fibonatti[2] total_way fibonatti[2] fibonatti 2 1000000007 if(possible){
      System.out.println(total_way);
    }else{
      System.out.println(0);
    } possible {
      System.out.println(total_way);
    } System.out.println(total_way) System.out.println System.out System System.out total_way {
      System.out.println(0);
    } System.out.println(0) System.out.println System.out System System.out 0 String[] args args
import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int[] broken = new int[m];
    for(int i = 0; i < m; i++){
      broken[i] = Integer.parseInt(sc.next());
    }

    boolean possible = true;
    int succesive_safe = 1;
    int succesive_broken = 0;
    Long total_way = 1L;
    int[] fibonatti = {0,0,1};
    int next_broken = 0;

    for(int i = 0; i < n; i++){
      if(m != 0){
        if(i + 1 != broken[next_broken]){
          if(succesive_safe == 0){
            succesive_broken = 0; 
          }
          succesive_safe++;
          
          fibonatti[0] = fibonatti[1];
          fibonatti[1] = fibonatti[2];
          fibonatti[2] = (fibonatti[1] + fibonatti[0]) % 1000000007;
          if(succesive_safe == 1){
            fibonatti[2] = 1;
          }
        }else if(succesive_broken == 0){
          succesive_broken++;
          total_way = total_way * fibonatti[2] % 1000000007;
          succesive_safe = 0;
          fibonatti[0] = 0;
          fibonatti[1] = 0;
          fibonatti[2] = 0;
          if(next_broken != m - 1){
            next_broken++;
          }
        }else{
          possible = false;
          break;
        }
      }else{
        succesive_safe++;
          
        fibonatti[0] = fibonatti[1];
        fibonatti[1] = fibonatti[2];
        fibonatti[2] = (fibonatti[1] + fibonatti[0]) % 1000000007;
      }
    }
    total_way = total_way * fibonatti[2] % 1000000007;
    if(possible){
      System.out.println(total_way);
    }else{
      System.out.println(0);
    }
  }
}