#Q139. 「一本通 4.4 练习 4」跳跳棋
「一本通 4.4 练习 4」跳跳棋
Description
Original source: BZOJ 2144
Halma is played on a number line. Pieces can only be placed on integer points, and no point can hold more than one piece. We use Halma to create a simple game: there are three pieces on the board at positions , , and . The goal is to move them to positions , , and (note: the pieces are indistinguishable) with the fewest moves possible.
The rules for moving are simple. Select any piece and jump it over a central piece. After the jump, the distance between the two pieces remains the same. Only one piece may be jumped over in a single move.
Write a program to first determine if the task can be completed. If possible, output the minimum number of moves required.

Input Format
The first line contains three integers representing the current positions of the pieces , , . The second line contains three integers representing the target positions , , .
Output Format
If there is no solution, output a single line NO. If the target can be reached, the first line should output YES, and the second line should output the minimum number of moves.
Sample 1
1 2 3
0 3 5
YES
2
Data Range and Hints
For of the data, the absolute values of the input integers do not exceed ;
For of the data, the absolute values of the input integers do not exceed ;
For of the data, the absolute values of the input integers do not exceed . It is guaranteed that , , are distinct, and , , are distinct.