import java.util.Scanner;

public class Main {
  private static final int mod = 1_000_000_007;
  private static void solve(int n, int m, int[] a) {
    int brokenIndex = 0;
    int[] steps = new int[n + 1];
    steps[0] = 1;
    if (brokenIndex < m && a[brokenIndex] == 1) {
      brokenIndex++;
    } else {
      steps[1] = 1;
    }
    for (int i = 2; i <= n; i++) {
      if (brokenIndex < m && a[brokenIndex] == i) {
        steps[i] = 0;
        brokenIndex++;
      } else {
        steps[i] = steps[i - 1] + steps[i - 2];
        if (steps[i] >= mod) steps[i] -= mod;
      }
    }
    System.out.println(steps[n]);
  }
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String[] nums = sc.nextLine().split(" ");
    int n = Integer.parseInt(nums[0]);
    int m = Integer.parseInt(nums[1]);
    int[] a = new int[m];
    for (int i = 0; i < m; i++) a[i] = Integer.parseInt(sc.nextLine());
    sc.close();
    solve(n, m, a);
  }
}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz