#include<bits/stdc++.h>
using namespace std;
int cnt;
int main(){
	while (1){
		system("./gen>std.in");
		system("./a<std.in>a.out");
		system("./b<std.in>b.out");
		if (system("diff a.out b.out")){
			puts("NO");
			return 0;
		}
		printf("YES %d\n",++cnt);
	}
}
