#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>

using namespace std;

main()
{
	int ll;
	while(scanf("%d",&ll)==1){
		ll*=10000000;
		int n;
		scanf("%d",&n);
		vector<int> a(n);
		for(int i=0; i<n; i++)
			scanf("%d",&a[i]);
		sort(a.begin(),a.end());
		int l=0, r=n-1;
		bool found=false;
		for(;l<r;l++){
			while(a[l]+a[r]>ll)r--;
			if(l<r&&a[l]+a[r]==ll){
				found=true;
				printf("yes %d %d\n", a[l], a[r]);
				break;
			}
		}
		if(!found)printf("danger\n");
	}
	
}
