import java.io.InputStream;
import java.io.PrintStream;
import java.util.*;

public class Main {

  public static void main(String[] args) {
    solve(System.in, System.out);
  }

  private static final long MOD = 1000000007L;


  static void solve(InputStream is, PrintStream os) {
    Scanner sc = new Scanner(is);

    /* read */
    int n = sc.nextInt();
    int m = sc.nextInt();

    Set<Integer> broken = new HashSet<>(m);

    for (int i = 0; i < m; i++) {
      broken.add(sc.nextInt());
    }

    long[] route = new long[n + 1];

    route[0] = 1;

    for (int i = 0; i < n; i++) {
      if (i + 1 <= n) {
        if (!broken.contains(i + 1)) {
          route[i + 1] = (route[i + 1] + route[i]) % MOD;
        }
      }
      if (i + 2 <= n) {
        if (!broken.contains(i + 2)) {
          route[i + 2] = (route[i + 2] + route[i]) % MOD;
        }
      }
    }

    os.println(route[n]);
  }
} import java.io.InputStream; InputStream java.io import java.io.PrintStream; PrintStream java.io import java.util.*; util.* java public class Main {

  public static void main(String[] args) {
    solve(System.in, System.out);
  }

  private static final long MOD = 1000000007L;


  static void solve(InputStream is, PrintStream os) {
    Scanner sc = new Scanner(is);

    /* read */
    int n = sc.nextInt();
    int m = sc.nextInt();

    Set<Integer> broken = new HashSet<>(m);

    for (int i = 0; i < m; i++) {
      broken.add(sc.nextInt());
    }

    long[] route = new long[n + 1];

    route[0] = 1;

    for (int i = 0; i < n; i++) {
      if (i + 1 <= n) {
        if (!broken.contains(i + 1)) {
          route[i + 1] = (route[i + 1] + route[i]) % MOD;
        }
      }
      if (i + 2 <= n) {
        if (!broken.contains(i + 2)) {
          route[i + 2] = (route[i + 2] + route[i]) % MOD;
        }
      }
    }

    os.println(route[n]);
  }
} Main private static final long MOD = 1000000007L; MOD 1000000007L public static void main(String[] args) {
    solve(System.in, System.out);
  } main {
    solve(System.in, System.out);
  } solve(System.in, System.out) solve System.in System System.in System.out System System.out String[] args args static void solve(InputStream is, PrintStream os) {
    Scanner sc = new Scanner(is);

    /* read */
    int n = sc.nextInt();
    int m = sc.nextInt();

    Set<Integer> broken = new HashSet<>(m);

    for (int i = 0; i < m; i++) {
      broken.add(sc.nextInt());
    }

    long[] route = new long[n + 1];

    route[0] = 1;

    for (int i = 0; i < n; i++) {
      if (i + 1 <= n) {
        if (!broken.contains(i + 1)) {
          route[i + 1] = (route[i + 1] + route[i]) % MOD;
        }
      }
      if (i + 2 <= n) {
        if (!broken.contains(i + 2)) {
          route[i + 2] = (route[i + 2] + route[i]) % MOD;
        }
      }
    }

    os.println(route[n]);
  } solve {
    Scanner sc = new Scanner(is);

    /* read */
    int n = sc.nextInt();
    int m = sc.nextInt();

    Set<Integer> broken = new HashSet<>(m);

    for (int i = 0; i < m; i++) {
      broken.add(sc.nextInt());
    }

    long[] route = new long[n + 1];

    route[0] = 1;

    for (int i = 0; i < n; i++) {
      if (i + 1 <= n) {
        if (!broken.contains(i + 1)) {
          route[i + 1] = (route[i + 1] + route[i]) % MOD;
        }
      }
      if (i + 2 <= n) {
        if (!broken.contains(i + 2)) {
          route[i + 2] = (route[i + 2] + route[i]) % MOD;
        }
      }
    }

    os.println(route[n]);
  } Scanner sc = new Scanner(is); sc new Scanner(is) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int m = sc.nextInt(); m sc.nextInt() sc.nextInt sc Set<Integer> broken = new HashSet<>(m); broken new HashSet<>(m) for (int i = 0; i < m; i++) {
      broken.add(sc.nextInt());
    } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
      broken.add(sc.nextInt());
    } {
      broken.add(sc.nextInt());
    } broken.add(sc.nextInt()) broken.add broken sc.nextInt() sc.nextInt sc long[] route = new long[n + 1]; route new long[n + 1] n + 1 n 1 route[0] = 1 route[0] route 0 1 for (int i = 0; i < n; i++) {
      if (i + 1 <= n) {
        if (!broken.contains(i + 1)) {
          route[i + 1] = (route[i + 1] + route[i]) % MOD;
        }
      }
      if (i + 2 <= n) {
        if (!broken.contains(i + 2)) {
          route[i + 2] = (route[i + 2] + route[i]) % MOD;
        }
      }
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      if (i + 1 <= n) {
        if (!broken.contains(i + 1)) {
          route[i + 1] = (route[i + 1] + route[i]) % MOD;
        }
      }
      if (i + 2 <= n) {
        if (!broken.contains(i + 2)) {
          route[i + 2] = (route[i + 2] + route[i]) % MOD;
        }
      }
    } {
      if (i + 1 <= n) {
        if (!broken.contains(i + 1)) {
          route[i + 1] = (route[i + 1] + route[i]) % MOD;
        }
      }
      if (i + 2 <= n) {
        if (!broken.contains(i + 2)) {
          route[i + 2] = (route[i + 2] + route[i]) % MOD;
        }
      }
    } if (i + 1 <= n) {
        if (!broken.contains(i + 1)) {
          route[i + 1] = (route[i + 1] + route[i]) % MOD;
        }
      } i + 1 <= n i + 1 i 1 n {
        if (!broken.contains(i + 1)) {
          route[i + 1] = (route[i + 1] + route[i]) % MOD;
        }
      } if (!broken.contains(i + 1)) {
          route[i + 1] = (route[i + 1] + route[i]) % MOD;
        } !broken.contains(i + 1) broken.contains(i + 1) broken.contains broken i + 1 i 1 {
          route[i + 1] = (route[i + 1] + route[i]) % MOD;
        } route[i + 1] = (route[i + 1] + route[i]) % MOD route[i + 1] route i + 1 i 1 (route[i + 1] + route[i]) % MOD (route[i + 1] + route[i]) route[i + 1] route i + 1 i 1 route[i] route i MOD if (i + 2 <= n) {
        if (!broken.contains(i + 2)) {
          route[i + 2] = (route[i + 2] + route[i]) % MOD;
        }
      } i + 2 <= n i + 2 i 2 n {
        if (!broken.contains(i + 2)) {
          route[i + 2] = (route[i + 2] + route[i]) % MOD;
        }
      } if (!broken.contains(i + 2)) {
          route[i + 2] = (route[i + 2] + route[i]) % MOD;
        } !broken.contains(i + 2) broken.contains(i + 2) broken.contains broken i + 2 i 2 {
          route[i + 2] = (route[i + 2] + route[i]) % MOD;
        } route[i + 2] = (route[i + 2] + route[i]) % MOD route[i + 2] route i + 2 i 2 (route[i + 2] + route[i]) % MOD (route[i + 2] + route[i]) route[i + 2] route i + 2 i 2 route[i] route i MOD os.println(route[n]) os.println os route[n] route n InputStream is is PrintStream os os public class Main {

  public static void main(String[] args) {
    solve(System.in, System.out);
  }

  private static final long MOD = 1000000007L;


  static void solve(InputStream is, PrintStream os) {
    Scanner sc = new Scanner(is);

    /* read */
    int n = sc.nextInt();
    int m = sc.nextInt();

    Set<Integer> broken = new HashSet<>(m);

    for (int i = 0; i < m; i++) {
      broken.add(sc.nextInt());
    }

    long[] route = new long[n + 1];

    route[0] = 1;

    for (int i = 0; i < n; i++) {
      if (i + 1 <= n) {
        if (!broken.contains(i + 1)) {
          route[i + 1] = (route[i + 1] + route[i]) % MOD;
        }
      }
      if (i + 2 <= n) {
        if (!broken.contains(i + 2)) {
          route[i + 2] = (route[i + 2] + route[i]) % MOD;
        }
      }
    }

    os.println(route[n]);
  }
} public class Main {

  public static void main(String[] args) {
    solve(System.in, System.out);
  }

  private static final long MOD = 1000000007L;


  static void solve(InputStream is, PrintStream os) {
    Scanner sc = new Scanner(is);

    /* read */
    int n = sc.nextInt();
    int m = sc.nextInt();

    Set<Integer> broken = new HashSet<>(m);

    for (int i = 0; i < m; i++) {
      broken.add(sc.nextInt());
    }

    long[] route = new long[n + 1];

    route[0] = 1;

    for (int i = 0; i < n; i++) {
      if (i + 1 <= n) {
        if (!broken.contains(i + 1)) {
          route[i + 1] = (route[i + 1] + route[i]) % MOD;
        }
      }
      if (i + 2 <= n) {
        if (!broken.contains(i + 2)) {
          route[i + 2] = (route[i + 2] + route[i]) % MOD;
        }
      }
    }

    os.println(route[n]);
  }
} Main
import java.io.InputStream;
import java.io.PrintStream;
import java.util.*;

public class Main {

  public static void main(String[] args) {
    solve(System.in, System.out);
  }

  private static final long MOD = 1000000007L;


  static void solve(InputStream is, PrintStream os) {
    Scanner sc = new Scanner(is);

    /* read */
    int n = sc.nextInt();
    int m = sc.nextInt();

    Set<Integer> broken = new HashSet<>(m);

    for (int i = 0; i < m; i++) {
      broken.add(sc.nextInt());
    }

    long[] route = new long[n + 1];

    route[0] = 1;

    for (int i = 0; i < n; i++) {
      if (i + 1 <= n) {
        if (!broken.contains(i + 1)) {
          route[i + 1] = (route[i + 1] + route[i]) % MOD;
        }
      }
      if (i + 2 <= n) {
        if (!broken.contains(i + 2)) {
          route[i + 2] = (route[i + 2] + route[i]) % MOD;
        }
      }
    }

    os.println(route[n]);
  }
}