human
Check if two arrays are permutations of each other using Mathematical Operation | Function to check if arrays are permutations of each other.
Calculating sum and multiply of first array.
Calculating sum and multiply of second array.
If sum and mul of both arrays are equal , return true , else return false ..
Driver code"
Solution in Python:

Give me a code to check if two arrays are permutations of each other using Mathematical Operation and the other steps required?
assistant
#Here is code to check if two arrays are permutations of each other using Mathematical Operation and the other steps required.
 def arePermutations ( a , b , n , m ) :
	sum1 , sum2 , mul1 , mul2 = 0 , 0 , 1 , 1
	for i in range ( n ) :
		sum1 += a [ i ]
		mul1 *= a [ i ]
	for i in range ( m ) :
		sum2 += b [ i ]
		mul2 *= b [ i ]
	return ( ( sum1 == sum2 ) and ( mul1 == mul2 ) )
if __name__ == " _ _ main _ _ " :
	a = [ 1 , 3 , 2 ]
	b = [ 3 , 1 , 2 ]
	n = len ( a )
	m = len ( b )
	if arePermutations ( a , b , n , m ) :
		print ( " Yes " )
	else :
		print ( " No " )