let inpA = readLine()! let inpB = readLine()! let oldVers = inpA.split(separator: ".").map{Int($0)!} let curVers = inpB.split(separator: ".").map{Int($0)!} let oneThousandMillion = [1000000,1000,1] var oldVer = 0 var curVer = 0 for i in 0 ... 2 { oldVer += (oldVers[i] * oneThousandMillion[i]) curVer += (curVers[i] * oneThousandMillion[i]) } print(curVer < oldVer ? "YES" : "NO")