Implementation:
if numSCCs == 1:
print "YES"
else:
print "NO"
a = -1
b = -1
for v from 1 to n:
if a == -1:
a = v
else if scc[v] != scc[a]:
b = v
break
print a, b
Find the first two nodes with different SCC IDs. This guarantees they are in different components.
This runs in time and uses space.