Omicronian Domino
On the planet Omicron Persei 8, Domino is the second popular entertainment after Earth television broadcasts. Omicronian Domino is the game in which a chain of bones is built. Each bone has two halves. Each half has a non-negative integer number of points written on it (the number of points does not exceed 100000). The bones of the chain touch their halves only if the contacting halves have equal number of points. There are bones with all possible point combinations in Omicronian domino, and each bone is unique.
Lrrr, the leader of Omicron Persei 8, lost his last domino game. This has not happened for a long time, because Lrrr usually ate his defeater. That is why Lrrr remains the most skillful dominoer on his planet. Though, he wishes to restore the chain of bones of that last game. He took the required bones, and immediately built a chain of length n (1 ≤ n ≤ 100000). Unfortunately, the chain turned out to differ from that last game. Lrrr does not want to rebuild the chain, and he decides to make several transformations with the chain. Each transformation consists of actions:
Bones with numbers l and r are taken such that the left half of l-th and right half of r-th have equal points (0 ≤ l ≤ r < n). The subchain from l to r is cut from the chain.
A shift d is taken (0 ≤ d ≤ r-1). d bones are extracted from the left side of subchain. Then the left and right parts of the subchain are rotated and glued again.
The result subchain is rotated if needed.
The subchain is inserted into the chain to the position p (0 ≤ p ≤ n-(r-l+1)), such that the chain stays correct.
The example of a transformation:
Lrrr wants to make not more than n transformations. Otherwise, it is better to rebuild the chain from scratch.
Input
First line contains number n. Second line contains n+1 numbers separated by spaces - the points of the bones of the chain Lrrr wants to get. Third line contains n+1 - the points of the bones of the chain that Lrrr has just built.
Output
In the first line output "No" if it is impossible to get the desired chain using at most n transformations. Otherwise output "Yes" in the first line. In each of next lines output the description of the current transformation: numbers l, r, d, then letter "R" or letter "N", then number p. Separate all entities with a space. Letter "R" means that action 3 of the transformation should be performed. "N" otherwise.
The transformation from the figure is described as: "1 3 1 R 3".