human
Check if point ( X , Y ) can be reached from origin ( 0 , 0 ) with jump of 1 and N perpendicularly simultaneously | Function to check if ( X , Y ) is reachable from ( 0 , 0 ) using the jumps of given type.
Case where source & destination are the same.
Check for even N ( X , Y ) is reachable or not.
If N is odd and parity of X and Y is different return , no valid sequence of jumps exist.
Driver Code"
Solution in Python:
assistant
#Here is code to check if point ( X , Y ) can be reached from origin ( 0 , 0 ) with jump of 1 and N perpendicularly simultaneously and the other steps required.
 def checkReachability ( N , X , Y ) :
	if ( X == 0 and Y == 0 ) :
		return " YES "
	if ( N % 2 == 0 ) :
		return " YES "
	else :
		if ( X % 2 != Y % 2 ) :
			return " NO "
		else :
			return " YES "
if __name__ == ' _ _ main _ _ ' :
	N = 2
	X = 5
	Y = 4
	print ( checkReachability ( N , X , Y ) )