Because you should print "No" only if nodex x and y have common predecessor. In other cases you should print "YES".
Where this is written in the statement? Why can't I solve the problem this way: 1. Make transitive closure of the given graph (matrix A)using Floyd. 2. For every request (pair i j) print "YES" if A[i][j] = 1 otherwise print "No".