import java.math.BigDecimal;
import java.util.*;
import java.util.stream.*;
class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    long[] dp = new long[N+1];
    for (int i = 0; i < M; i++) {
      dp[sc.nextInt()] = -1;
    }
    dp[0] = 1;
    dp[1] = dp[1] == 0 ? 1 : 0;
    for (int i = 2; i < N+1; i++) {
      if (dp[i] == -1) {
        dp[i] = 0;
      } else {
        dp[i] = dp[i-1] + dp[i-2];
        dp[i] %= 1000000007;
      }
    }
    System.out.println(dp[N]);
  }
} import java.math.BigDecimal; BigDecimal java.math import java.util.*; util.* java import java.util.stream.*; stream.* java.util class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    long[] dp = new long[N+1];
    for (int i = 0; i < M; i++) {
      dp[sc.nextInt()] = -1;
    }
    dp[0] = 1;
    dp[1] = dp[1] == 0 ? 1 : 0;
    for (int i = 2; i < N+1; i++) {
      if (dp[i] == -1) {
        dp[i] = 0;
      } else {
        dp[i] = dp[i-1] + dp[i-2];
        dp[i] %= 1000000007;
      }
    }
    System.out.println(dp[N]);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    long[] dp = new long[N+1];
    for (int i = 0; i < M; i++) {
      dp[sc.nextInt()] = -1;
    }
    dp[0] = 1;
    dp[1] = dp[1] == 0 ? 1 : 0;
    for (int i = 2; i < N+1; i++) {
      if (dp[i] == -1) {
        dp[i] = 0;
      } else {
        dp[i] = dp[i-1] + dp[i-2];
        dp[i] %= 1000000007;
      }
    }
    System.out.println(dp[N]);
  } main {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    long[] dp = new long[N+1];
    for (int i = 0; i < M; i++) {
      dp[sc.nextInt()] = -1;
    }
    dp[0] = 1;
    dp[1] = dp[1] == 0 ? 1 : 0;
    for (int i = 2; i < N+1; i++) {
      if (dp[i] == -1) {
        dp[i] = 0;
      } else {
        dp[i] = dp[i-1] + dp[i-2];
        dp[i] %= 1000000007;
      }
    }
    System.out.println(dp[N]);
  } 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 long[] dp = new long[N+1]; dp new long[N+1] N+1 N 1 for (int i = 0; i < M; i++) {
      dp[sc.nextInt()] = -1;
    } int i = 0; int i = 0; i 0 i < M i M i++ i++ i {
      dp[sc.nextInt()] = -1;
    } {
      dp[sc.nextInt()] = -1;
    } dp[sc.nextInt()] = -1 dp[sc.nextInt()] dp sc.nextInt() sc.nextInt sc -1 1 dp[0] = 1 dp[0] dp 0 1 dp[1] = dp[1] == 0 ? 1 : 0 dp[1] dp 1 dp[1] == 0 ? 1 : 0 dp[1] == 0 dp[1] dp 1 0 1 0 for (int i = 2; i < N+1; i++) {
      if (dp[i] == -1) {
        dp[i] = 0;
      } else {
        dp[i] = dp[i-1] + dp[i-2];
        dp[i] %= 1000000007;
      }
    } int i = 2; int i = 2; i 2 i < N+1 i N+1 N 1 i++ i++ i {
      if (dp[i] == -1) {
        dp[i] = 0;
      } else {
        dp[i] = dp[i-1] + dp[i-2];
        dp[i] %= 1000000007;
      }
    } {
      if (dp[i] == -1) {
        dp[i] = 0;
      } else {
        dp[i] = dp[i-1] + dp[i-2];
        dp[i] %= 1000000007;
      }
    } if (dp[i] == -1) {
        dp[i] = 0;
      } else {
        dp[i] = dp[i-1] + dp[i-2];
        dp[i] %= 1000000007;
      } dp[i] == -1 dp[i] dp i -1 1 {
        dp[i] = 0;
      } dp[i] = 0 dp[i] dp i 0 {
        dp[i] = dp[i-1] + dp[i-2];
        dp[i] %= 1000000007;
      } dp[i] = dp[i-1] + dp[i-2] dp[i] dp i dp[i-1] + dp[i-2] dp[i-1] dp i-1 i 1 dp[i-2] dp i-2 i 2 dp[i] %= 1000000007 dp[i] dp i 1000000007 System.out.println(dp[N]) System.out.println System.out System System.out dp[N] dp N String[] args args
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.*;
class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    long[] dp = new long[N+1];
    for (int i = 0; i < M; i++) {
      dp[sc.nextInt()] = -1;
    }
    dp[0] = 1;
    dp[1] = dp[1] == 0 ? 1 : 0;
    for (int i = 2; i < N+1; i++) {
      if (dp[i] == -1) {
        dp[i] = 0;
      } else {
        dp[i] = dp[i-1] + dp[i-2];
        dp[i] %= 1000000007;
      }
    }
    System.out.println(dp[N]);
  }
}