public static void main(String[] args) {
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
			String[] line = br.readLine().split("\\s+");
			long n = Long.valueOf(line[0]);
			long base = Long.valueOf(line[1]);
			long[] seq = seq(n, base);
						
			boolean flag = true;
			
			for(int i = 0, j = seq.length - 1; i < j; i++, j--) {
				if(seq[i] != seq[j]) {
					flag = false;
					break;
				}
			}
			
			if(flag) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
			int j = seq.length - 1;
			System.out.print(seq[j]);
			for(j = j - 1; j >= 0; j--) {
				System.out.print(" " + seq[j]);
			}
			System.out.println();
			
		} catch(Exception ex) {
			ex.printStackTrace();
		}
		
	}