import java.util.*;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int m = Integer.parseInt(sc.next());
    int x[] = new int[m];
    long s[] = new long[n];
    int ng[] = new int[n];
    int ans = 0;
    int t = 0;
    
    for (int i=0; i<m; i++){
      x[i] = Integer.parseInt(sc.next());
    }
    
    int j = 0;
    for(int i=0; i<n; i++){
      ng[i] = 0;
      if(m > 0 &&i == x[j]-1){
        ng[i] = 1;
        if(j != m-1){ 
          j++;
        }
      }
    }
    
    if(n==1){
      System.out.println("1");
      return;
    }
    
    if(n==2){
      if(m==1){
        System.out.println("1");
        return;
      } else {
      	System.out.println("2");
        return;
      }
    }
    
    if(ng[0]==1){
	  s[0] = 0;
      if(ng[1] == 1) {
        s[1] = 0;
      } else {
        s[1] = 1;
      }
    } else {
      s[0] = 1;
      if(ng[1] == 1){
        s[1] = 0;
      } else {
        s[1] = 2;
      }
    }
    
    for(int i=2; i<n; i++){
      if(ng[i] == 0){
        s[i] = (s[i-1]%1000000007 + s[i-2]%1000000007)%1000000007;
      } else {
        s[i] = 0;
      }
    }
    
    System.out.println(s[n-1]%1000000007);
  }
} import java.util.*; util.* java class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int m = Integer.parseInt(sc.next());
    int x[] = new int[m];
    long s[] = new long[n];
    int ng[] = new int[n];
    int ans = 0;
    int t = 0;
    
    for (int i=0; i<m; i++){
      x[i] = Integer.parseInt(sc.next());
    }
    
    int j = 0;
    for(int i=0; i<n; i++){
      ng[i] = 0;
      if(m > 0 &&i == x[j]-1){
        ng[i] = 1;
        if(j != m-1){ 
          j++;
        }
      }
    }
    
    if(n==1){
      System.out.println("1");
      return;
    }
    
    if(n==2){
      if(m==1){
        System.out.println("1");
        return;
      } else {
      	System.out.println("2");
        return;
      }
    }
    
    if(ng[0]==1){
	  s[0] = 0;
      if(ng[1] == 1) {
        s[1] = 0;
      } else {
        s[1] = 1;
      }
    } else {
      s[0] = 1;
      if(ng[1] == 1){
        s[1] = 0;
      } else {
        s[1] = 2;
      }
    }
    
    for(int i=2; i<n; i++){
      if(ng[i] == 0){
        s[i] = (s[i-1]%1000000007 + s[i-2]%1000000007)%1000000007;
      } else {
        s[i] = 0;
      }
    }
    
    System.out.println(s[n-1]%1000000007);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int m = Integer.parseInt(sc.next());
    int x[] = new int[m];
    long s[] = new long[n];
    int ng[] = new int[n];
    int ans = 0;
    int t = 0;
    
    for (int i=0; i<m; i++){
      x[i] = Integer.parseInt(sc.next());
    }
    
    int j = 0;
    for(int i=0; i<n; i++){
      ng[i] = 0;
      if(m > 0 &&i == x[j]-1){
        ng[i] = 1;
        if(j != m-1){ 
          j++;
        }
      }
    }
    
    if(n==1){
      System.out.println("1");
      return;
    }
    
    if(n==2){
      if(m==1){
        System.out.println("1");
        return;
      } else {
      	System.out.println("2");
        return;
      }
    }
    
    if(ng[0]==1){
	  s[0] = 0;
      if(ng[1] == 1) {
        s[1] = 0;
      } else {
        s[1] = 1;
      }
    } else {
      s[0] = 1;
      if(ng[1] == 1){
        s[1] = 0;
      } else {
        s[1] = 2;
      }
    }
    
    for(int i=2; i<n; i++){
      if(ng[i] == 0){
        s[i] = (s[i-1]%1000000007 + s[i-2]%1000000007)%1000000007;
      } else {
        s[i] = 0;
      }
    }
    
    System.out.println(s[n-1]%1000000007);
  } main {
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int m = Integer.parseInt(sc.next());
    int x[] = new int[m];
    long s[] = new long[n];
    int ng[] = new int[n];
    int ans = 0;
    int t = 0;
    
    for (int i=0; i<m; i++){
      x[i] = Integer.parseInt(sc.next());
    }
    
    int j = 0;
    for(int i=0; i<n; i++){
      ng[i] = 0;
      if(m > 0 &&i == x[j]-1){
        ng[i] = 1;
        if(j != m-1){ 
          j++;
        }
      }
    }
    
    if(n==1){
      System.out.println("1");
      return;
    }
    
    if(n==2){
      if(m==1){
        System.out.println("1");
        return;
      } else {
      	System.out.println("2");
        return;
      }
    }
    
    if(ng[0]==1){
	  s[0] = 0;
      if(ng[1] == 1) {
        s[1] = 0;
      } else {
        s[1] = 1;
      }
    } else {
      s[0] = 1;
      if(ng[1] == 1){
        s[1] = 0;
      } else {
        s[1] = 2;
      }
    }
    
    for(int i=2; i<n; i++){
      if(ng[i] == 0){
        s[i] = (s[i-1]%1000000007 + s[i-2]%1000000007)%1000000007;
      } else {
        s[i] = 0;
      }
    }
    
    System.out.println(s[n-1]%1000000007);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int m = Integer.parseInt(sc.next()); m Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int x[] = new int[m]; x new int[m] m long s[] = new long[n]; s new long[n] n int ng[] = new int[n]; ng new int[n] n int ans = 0; ans 0 int t = 0; t 0 for (int i=0; i<m; i++){
      x[i] = Integer.parseInt(sc.next());
    } int i=0; int i=0; i 0 i<m i m i++ i++ i {
      x[i] = Integer.parseInt(sc.next());
    } {
      x[i] = Integer.parseInt(sc.next());
    } x[i] = Integer.parseInt(sc.next()) x[i] x i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int j = 0; j 0 for(int i=0; i<n; i++){
      ng[i] = 0;
      if(m > 0 &&i == x[j]-1){
        ng[i] = 1;
        if(j != m-1){ 
          j++;
        }
      }
    } int i=0; int i=0; i 0 i<n i n i++ i++ i {
      ng[i] = 0;
      if(m > 0 &&i == x[j]-1){
        ng[i] = 1;
        if(j != m-1){ 
          j++;
        }
      }
    } {
      ng[i] = 0;
      if(m > 0 &&i == x[j]-1){
        ng[i] = 1;
        if(j != m-1){ 
          j++;
        }
      }
    } ng[i] = 0 ng[i] ng i 0 if(m > 0 &&i == x[j]-1){
        ng[i] = 1;
        if(j != m-1){ 
          j++;
        }
      } m > 0 &&i == x[j]-1 m > 0 m 0 i == x[j]-1 i x[j]-1 x[j] x j 1 {
        ng[i] = 1;
        if(j != m-1){ 
          j++;
        }
      } ng[i] = 1 ng[i] ng i 1 if(j != m-1){ 
          j++;
        } j != m-1 j m-1 m 1 { 
          j++;
        } j++ j if(n==1){
      System.out.println("1");
      return;
    } n==1 n 1 {
      System.out.println("1");
      return;
    } System.out.println("1") System.out.println System.out System System.out "1" return; if(n==2){
      if(m==1){
        System.out.println("1");
        return;
      } else {
      	System.out.println("2");
        return;
      }
    } n==2 n 2 {
      if(m==1){
        System.out.println("1");
        return;
      } else {
      	System.out.println("2");
        return;
      }
    } if(m==1){
        System.out.println("1");
        return;
      } else {
      	System.out.println("2");
        return;
      } m==1 m 1 {
        System.out.println("1");
        return;
      } System.out.println("1") System.out.println System.out System System.out "1" return; {
      	System.out.println("2");
        return;
      } System.out.println("2") System.out.println System.out System System.out "2" return; if(ng[0]==1){
	  s[0] = 0;
      if(ng[1] == 1) {
        s[1] = 0;
      } else {
        s[1] = 1;
      }
    } else {
      s[0] = 1;
      if(ng[1] == 1){
        s[1] = 0;
      } else {
        s[1] = 2;
      }
    } ng[0]==1 ng[0] ng 0 1 {
	  s[0] = 0;
      if(ng[1] == 1) {
        s[1] = 0;
      } else {
        s[1] = 1;
      }
    } s[0] = 0 s[0] s 0 0 if(ng[1] == 1) {
        s[1] = 0;
      } else {
        s[1] = 1;
      } ng[1] == 1 ng[1] ng 1 1 {
        s[1] = 0;
      } s[1] = 0 s[1] s 1 0 {
        s[1] = 1;
      } s[1] = 1 s[1] s 1 1 {
      s[0] = 1;
      if(ng[1] == 1){
        s[1] = 0;
      } else {
        s[1] = 2;
      }
    } s[0] = 1 s[0] s 0 1 if(ng[1] == 1){
        s[1] = 0;
      } else {
        s[1] = 2;
      } ng[1] == 1 ng[1] ng 1 1 {
        s[1] = 0;
      } s[1] = 0 s[1] s 1 0 {
        s[1] = 2;
      } s[1] = 2 s[1] s 1 2 for(int i=2; i<n; i++){
      if(ng[i] == 0){
        s[i] = (s[i-1]%1000000007 + s[i-2]%1000000007)%1000000007;
      } else {
        s[i] = 0;
      }
    } int i=2; int i=2; i 2 i<n i n i++ i++ i {
      if(ng[i] == 0){
        s[i] = (s[i-1]%1000000007 + s[i-2]%1000000007)%1000000007;
      } else {
        s[i] = 0;
      }
    } {
      if(ng[i] == 0){
        s[i] = (s[i-1]%1000000007 + s[i-2]%1000000007)%1000000007;
      } else {
        s[i] = 0;
      }
    } if(ng[i] == 0){
        s[i] = (s[i-1]%1000000007 + s[i-2]%1000000007)%1000000007;
      } else {
        s[i] = 0;
      } ng[i] == 0 ng[i] ng i 0 {
        s[i] = (s[i-1]%1000000007 + s[i-2]%1000000007)%1000000007;
      } s[i] = (s[i-1]%1000000007 + s[i-2]%1000000007)%1000000007 s[i] s i (s[i-1]%1000000007 + s[i-2]%1000000007)%1000000007 (s[i-1]%1000000007 + s[i-2]%1000000007) s[i-1]%1000000007 s[i-1] s i-1 i 1 1000000007 s[i-2]%1000000007 s[i-2] s i-2 i 2 1000000007 1000000007 {
        s[i] = 0;
      } s[i] = 0 s[i] s i 0 System.out.println(s[n-1]%1000000007) System.out.println System.out System System.out s[n-1]%1000000007 s[n-1] s n-1 n 1 1000000007 String[] args args
import java.util.*;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int m = Integer.parseInt(sc.next());
    int x[] = new int[m];
    long s[] = new long[n];
    int ng[] = new int[n];
    int ans = 0;
    int t = 0;
    
    for (int i=0; i<m; i++){
      x[i] = Integer.parseInt(sc.next());
    }
    
    int j = 0;
    for(int i=0; i<n; i++){
      ng[i] = 0;
      if(m > 0 &&i == x[j]-1){
        ng[i] = 1;
        if(j != m-1){ 
          j++;
        }
      }
    }
    
    if(n==1){
      System.out.println("1");
      return;
    }
    
    if(n==2){
      if(m==1){
        System.out.println("1");
        return;
      } else {
      	System.out.println("2");
        return;
      }
    }
    
    if(ng[0]==1){
	  s[0] = 0;
      if(ng[1] == 1) {
        s[1] = 0;
      } else {
        s[1] = 1;
      }
    } else {
      s[0] = 1;
      if(ng[1] == 1){
        s[1] = 0;
      } else {
        s[1] = 2;
      }
    }
    
    for(int i=2; i<n; i++){
      if(ng[i] == 0){
        s[i] = (s[i-1]%1000000007 + s[i-2]%1000000007)%1000000007;
      } else {
        s[i] = 0;
      }
    }
    
    System.out.println(s[n-1]%1000000007);
  }
}
