import std.stdio;
import std.ascii;
import std.c.stdio;
import std.range;
import std.array;
import std.functional;
import std.algorithm;
import std.conv;
import std.container;
import std.math;
import std.numeric;
import std.string;
import std.c.string;
import std.regex;
import std.typecons;

void main() {
    int N, M; scanf("%d %d\n", &N, &M);
    int[] L = new int[M];
    foreach (i; 0 .. M) {
        scanf("%d\n", &L[i]);
    }

    foreach (i; 0 .. M) {
        if (gcd(L[i], N) == 1) {
            writeln("Yes");
            return;
        }
    }
    writeln("No");
}