CF817A.Treasure Hunt

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Captain Bill the Hummingbird and his crew recieved an interesting challenge offer. Some stranger gave them a map, potion of teleportation and said that only this potion might help them to reach the treasure.

Bottle with potion has two values xx and yy written on it. These values define four moves which can be performed using the potion:

Map shows that the position of Captain Bill the Hummingbird is (x1,y1)(x_{1},y_{1}) and the position of the treasure is (x2,y2)(x_{2},y_{2}) .

You task is to tell Captain Bill the Hummingbird whether he should accept this challenge or decline. If it is possible for Captain to reach the treasure using the potion then output "YES", otherwise "NO" (without quotes).

The potion can be used infinite amount of times.

输入格式

The first line contains four integer numbers x1,y1,x2,y2x_{1},y_{1},x_{2},y_{2} ( 105<=x1,y1,x2,y2<=105-10^{5}<=x_{1},y_{1},x_{2},y_{2}<=10^{5} ) — positions of Captain Bill the Hummingbird and treasure respectively.

The second line contains two integer numbers x,yx,y ( 1<=x,y<=1051<=x,y<=10^{5} ) — values on the potion bottle.

输出格式

Print "YES" if it is possible for Captain to reach the treasure using the potion, otherwise print "NO" (without quotes).

输入输出样例

  • 输入#1

    0 0 0 6
    2 3
    

    输出#1

    YES
    
  • 输入#2

    1 1 3 6
    1 5
    

    输出#2

    NO
    

说明/提示

In the first example there exists such sequence of moves:

  1. — the first type of move
  2. — the third type of move
首页