//06-图2 Saving James Bond - Easy Versionimport java.util.Scanner;import java.lang.Math;import java.util.ArrayList;classnode{
int data;
node next;}classlocation{
int x;
int y;}publicclassMain{static boolean[] visited =newboolean[100];staticvoidread(Scanner s, location[] locations){for(int i =0; i < locations.length; i ++){
locations[i]=newlocation();
locations[i].x = s.nextInt();
locations[i].y = s.nextInt();}}static double distance(int x1, int y1, int x2, int y2){return Math.sqrt(Math.pow(x1 - x2,2)+ Math.pow(y1 - y2,2));}staticvoidnodeadd(node n, int x){
node newnode =newnode();
newnode.data = x;
newnode.next = n.next;
n.next = newnode;}staticvoidgraphadd(node[] nodes, int i, int j){nodeadd(nodes[i], j);nodeadd(nodes[j], i);}staticvoidbulid(location[] locations, node[] nodes, int D){for(int i =0; i < locations.length -1; i ++){for(int j = i +1; j < locations.length; j ++){if(distance(locations[i].x, locations[i].y, locations[j].x, locations[j].y)<=D){graphadd(nodes, i, j);}}}}staticvoidstart(location[] locations, int D, ArrayList<Integer> arr){for(int i =0; i < locations.length; i ++){if(distance(locations[i].x, locations[i].y,0,0)<=D+15) arr.add(i);}}staticvoiddfs(node[] nodes, node v, ArrayList<Integer> path){
visited[v.data]=true;for(node p = v.next; p !=null; p = p.next){if(!visited[p.data]){
path.add(p.data);dfs(nodes, nodes[p.data], path);}}}staticvoidjudge(ArrayList<Integer>[] paths, location[] locations, int D){
String result ="No";for(int i =0; i < paths.length; i ++){for(int j =0; j < paths[i].size(); j ++){if(Math.abs(locations[paths[i].get(j)].x)>=(50-D)|| Math.abs(locations[paths[i].get(j)].y)>=(50-D)){
result ="Yes";break;}}}
System.out.println(result);}publicstaticvoidmain(String[] args){
Scanner s =newScanner(System.in);
ArrayList<Integer> arr =newArrayList<>();
int N,D;N= s.nextInt();D= s.nextInt();
node[] nodes =newnode[N];for(int i =0; i <N; i ++){
nodes[i]=newnode();
nodes[i].data = i;}
location[] locations =newlocation[N];read(s, locations);bulid(locations, nodes,D);start(locations,D, arr);
ArrayList<Integer>[] paths =newArrayList[arr.size()];for(int i =0; i < arr.size(); i ++){
paths[i]=newArrayList<>();
paths[i].add(nodes[arr.get(i)].data);dfs(nodes, nodes[arr.get(i)], paths[i]);}judge(paths, locations,D);}}