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[] a = new int[N+1];

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

    sc.close();

    long[] dp = new long[N+1];
    
    long mod = 1000000007;

    dp[N] = 1;

    for (int i = N-1; 0 <= i ; i--) {
      if (a[i] == 1){
        dp[i] = 0;
      } else {
        if (i == N - 1){
          dp[i] = dp[N];
        } else if (N < i+2){
          dp[i] = (dp[i+1] + dp[N]) % mod;
        }else {
          dp[i] = (dp[i+1] + dp[i+2]) % mod;
        }
      }
    }

    System.out.println(dp[0]);
    
  }

} 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[] a = new int[N+1];

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

    sc.close();

    long[] dp = new long[N+1];
    
    long mod = 1000000007;

    dp[N] = 1;

    for (int i = N-1; 0 <= i ; i--) {
      if (a[i] == 1){
        dp[i] = 0;
      } else {
        if (i == N - 1){
          dp[i] = dp[N];
        } else if (N < i+2){
          dp[i] = (dp[i+1] + dp[N]) % mod;
        }else {
          dp[i] = (dp[i+1] + dp[i+2]) % mod;
        }
      }
    }

    System.out.println(dp[0]);
    
  }

} Main public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);
    
    int N = sc.nextInt();
    int M = sc.nextInt();
    int[] a = new int[N+1];

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

    sc.close();

    long[] dp = new long[N+1];
    
    long mod = 1000000007;

    dp[N] = 1;

    for (int i = N-1; 0 <= i ; i--) {
      if (a[i] == 1){
        dp[i] = 0;
      } else {
        if (i == N - 1){
          dp[i] = dp[N];
        } else if (N < i+2){
          dp[i] = (dp[i+1] + dp[N]) % mod;
        }else {
          dp[i] = (dp[i+1] + dp[i+2]) % mod;
        }
      }
    }

    System.out.println(dp[0]);
    
  } main {

    Scanner sc = new Scanner(System.in);
    
    int N = sc.nextInt();
    int M = sc.nextInt();
    int[] a = new int[N+1];

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

    sc.close();

    long[] dp = new long[N+1];
    
    long mod = 1000000007;

    dp[N] = 1;

    for (int i = N-1; 0 <= i ; i--) {
      if (a[i] == 1){
        dp[i] = 0;
      } else {
        if (i == N - 1){
          dp[i] = dp[N];
        } else if (N < i+2){
          dp[i] = (dp[i+1] + dp[N]) % mod;
        }else {
          dp[i] = (dp[i+1] + dp[i+2]) % mod;
        }
      }
    }

    System.out.println(dp[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[] a = new int[N+1]; a new int[N+1] N+1 N 1 for (int i = 0; i < M; i++) {
      int m = sc.nextInt();
      a[m] = 1;
    } int i = 0; int i = 0; i 0 i < M i M i++ i++ i {
      int m = sc.nextInt();
      a[m] = 1;
    } {
      int m = sc.nextInt();
      a[m] = 1;
    } int m = sc.nextInt(); m sc.nextInt() sc.nextInt sc a[m] = 1 a[m] a m 1 sc.close() sc.close sc long[] dp = new long[N+1]; dp new long[N+1] N+1 N 1 long mod = 1000000007; mod 1000000007 dp[N] = 1 dp[N] dp N 1 for (int i = N-1; 0 <= i ; i--) {
      if (a[i] == 1){
        dp[i] = 0;
      } else {
        if (i == N - 1){
          dp[i] = dp[N];
        } else if (N < i+2){
          dp[i] = (dp[i+1] + dp[N]) % mod;
        }else {
          dp[i] = (dp[i+1] + dp[i+2]) % mod;
        }
      }
    } int i = N-1; int i = N-1; i N-1 N 1 0 <= i 0 i i-- i-- i {
      if (a[i] == 1){
        dp[i] = 0;
      } else {
        if (i == N - 1){
          dp[i] = dp[N];
        } else if (N < i+2){
          dp[i] = (dp[i+1] + dp[N]) % mod;
        }else {
          dp[i] = (dp[i+1] + dp[i+2]) % mod;
        }
      }
    } {
      if (a[i] == 1){
        dp[i] = 0;
      } else {
        if (i == N - 1){
          dp[i] = dp[N];
        } else if (N < i+2){
          dp[i] = (dp[i+1] + dp[N]) % mod;
        }else {
          dp[i] = (dp[i+1] + dp[i+2]) % mod;
        }
      }
    } if (a[i] == 1){
        dp[i] = 0;
      } else {
        if (i == N - 1){
          dp[i] = dp[N];
        } else if (N < i+2){
          dp[i] = (dp[i+1] + dp[N]) % mod;
        }else {
          dp[i] = (dp[i+1] + dp[i+2]) % mod;
        }
      } a[i] == 1 a[i] a i 1 {
        dp[i] = 0;
      } dp[i] = 0 dp[i] dp i 0 {
        if (i == N - 1){
          dp[i] = dp[N];
        } else if (N < i+2){
          dp[i] = (dp[i+1] + dp[N]) % mod;
        }else {
          dp[i] = (dp[i+1] + dp[i+2]) % mod;
        }
      } if (i == N - 1){
          dp[i] = dp[N];
        } else if (N < i+2){
          dp[i] = (dp[i+1] + dp[N]) % mod;
        }else {
          dp[i] = (dp[i+1] + dp[i+2]) % mod;
        } i == N - 1 i N - 1 N 1 {
          dp[i] = dp[N];
        } dp[i] = dp[N] dp[i] dp i dp[N] dp N if (N < i+2){
          dp[i] = (dp[i+1] + dp[N]) % mod;
        }else {
          dp[i] = (dp[i+1] + dp[i+2]) % mod;
        } N < i+2 N i+2 i 2 {
          dp[i] = (dp[i+1] + dp[N]) % mod;
        } dp[i] = (dp[i+1] + dp[N]) % mod dp[i] dp i (dp[i+1] + dp[N]) % mod (dp[i+1] + dp[N]) dp[i+1] dp i+1 i 1 dp[N] dp N mod {
          dp[i] = (dp[i+1] + dp[i+2]) % mod;
        } dp[i] = (dp[i+1] + dp[i+2]) % mod dp[i] dp i (dp[i+1] + dp[i+2]) % mod (dp[i+1] + dp[i+2]) dp[i+1] dp i+1 i 1 dp[i+2] dp i+2 i 2 mod System.out.println(dp[0]) System.out.println System.out System System.out dp[0] dp 0 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[] a = new int[N+1];

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

    sc.close();

    long[] dp = new long[N+1];
    
    long mod = 1000000007;

    dp[N] = 1;

    for (int i = N-1; 0 <= i ; i--) {
      if (a[i] == 1){
        dp[i] = 0;
      } else {
        if (i == N - 1){
          dp[i] = dp[N];
        } else if (N < i+2){
          dp[i] = (dp[i+1] + dp[N]) % mod;
        }else {
          dp[i] = (dp[i+1] + dp[i+2]) % mod;
        }
      }
    }

    System.out.println(dp[0]);
    
  }

} public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);
    
    int N = sc.nextInt();
    int M = sc.nextInt();
    int[] a = new int[N+1];

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

    sc.close();

    long[] dp = new long[N+1];
    
    long mod = 1000000007;

    dp[N] = 1;

    for (int i = N-1; 0 <= i ; i--) {
      if (a[i] == 1){
        dp[i] = 0;
      } else {
        if (i == N - 1){
          dp[i] = dp[N];
        } else if (N < i+2){
          dp[i] = (dp[i+1] + dp[N]) % mod;
        }else {
          dp[i] = (dp[i+1] + dp[i+2]) % mod;
        }
      }
    }

    System.out.println(dp[0]);
    
  }

} 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[] a = new int[N+1];

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

    sc.close();

    long[] dp = new long[N+1];
    
    long mod = 1000000007;

    dp[N] = 1;

    for (int i = N-1; 0 <= i ; i--) {
      if (a[i] == 1){
        dp[i] = 0;
      } else {
        if (i == N - 1){
          dp[i] = dp[N];
        } else if (N < i+2){
          dp[i] = (dp[i+1] + dp[N]) % mod;
        }else {
          dp[i] = (dp[i+1] + dp[i+2]) % mod;
        }
      }
    }

    System.out.println(dp[0]);
    
  }

}