#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <set>
#include <map>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


int calc(int x,int y){
	if(y == 0){
		return x;
	}else{
		return calc(y,x%y);
	}
}

int main(){

	int N,M;
	scanf("%d %d",&N,&M);

	int tmp,common;

	scanf("%d",&tmp);

	if(tmp >= N){
		common = calc(tmp,N);
	}else{
		common = calc(N,tmp);
	}

	for(int loop = 1; loop < M; loop++){
		scanf("%d",&tmp);
		if(tmp >= common){
			common = calc(tmp,common);
		}else{
			common = calc(common,tmp);
		}
	}

	if(common == 1){
		printf("Yes\n");
	}else{
		printf("No\n");
	}

	return 0;
}