I met this problem as a subproblem many times and tried to find a solution for it but failed ,So I make an elegent statement for The problem is here /predownloaded/94/5d/945d1b0883127729b4bbb84faebda0f74566233a.png
Example : Input : 3 4 5 7 8 9 1 5 4 5 7 9 8 3 9 7 8 Output : YES 5 7 8 Input : 3 4 5 7 8 9 1 5 2 5 7 1 7 Output : NO