human
Mth element after K Right Rotations of an Array | Function to return Mth element of array after k right rotations.
The array comes to original state after N rotations.
If K is greater or equal to M.
Mth element after k right rotations is ( N - K ) + ( M - 1 ) th element of the array.
Otherwise.
( M - K - 1 ) th element of the array.
Return the result.
Driver Code"
How can the above be solved in Python?

=====
Can you provide a code to mth element after K Right Rotations of an Array and the other steps required?
assistant
#Here is code to mth element after K Right Rotations of an Array and the other steps required.
 def getFirstElement ( a , N , K , M ) :
	K %= N
	if ( K >= M ) :
		index = ( N - K ) + ( M - 1 )
	else :
		index = ( M - K - 1 )
	result = a [ index ]
	return result
if __name__ == " _ _ main _ _ " :
	a = [ 1 , 2 , 3 , 4 , 5 ]
	N = len ( a )
	K , M = 3 , 2
	print ( getFirstElement ( a , N , K , M ) )