You are given two integer arrays and , each of length .
In one operation, choose two adjacent entries of and apply one of these rules:
Operations may be repeated, and intermediate entries may be any integers.
Determine whether can be transformed into using zero or more operations. Output Yes if it can, and No otherwise.
Yes and No are case-insensitive.
Apply the first rule to obtain .
Apply the first rule in reverse to obtain .
First break the equality, then use the first rule: . The intermediate value is allowed.