System.in.eachLine{println it=~/(\S*) (?!\S*\1)/?"NO":"YES"}