Given are the coordinates of two queens on a chessboard. Find out whether they take each other. Taking in chess means attacking. The queen moves any number of vacant squares horizontally, vertically, or diagonally.
Input data format
Four integer numbers .
Output data format
Type "YES" (uppercase) if they take each other and "NO" if they don't.
You may need to calculate the absolute value of the number. You can do it this way:
import kotlin.math.*
println(abs(-5)) // 5