/*
  [BAPC'07] CUTTING BANKNOTES
  by: Jan Kuipers
*/

using namespace std;

#include <iostream>

int gcd (int a, int b) {
  return b==0 ? a : gcd(b,a%b);
}

int main () {

  int runs;
  cin>>runs;
	 
  while (runs--) {
    double tmpX;
    cin>>tmpX;
    int X = (int)(100*tmpX);

    int N;
    cin>>N;

    int d=0, b;
    for (int i=0; i<N; i++) {
      cin>>b;
      d=gcd(d,100*b);
    }

    while (d%2==0) d/=2;
    cout<<(X%d==0 ? "yes" : "no")<<endl;
  }

  return 0;
}
