A. Treasure Hunt

Codeforces
IDCF817A
Time1000ms
Memory256MB
Difficulty
implementationmathnumber theory
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 _x_ and _y_ 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 (_x_1, _y_1) and the position of the treasure is (_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.** ## Input The first line contains four integer numbers _x_1, _y_1, _x_2, _y_2 ( - 105 ≤ _x_1, _y_1, _x_2, _y_2 ≤ 105) — positions of Captain Bill the Hummingbird and treasure respectively. The second line contains two integer numbers _x_, _y_ (1 ≤ _x_, _y_ ≤ 105) — values on the potion bottle. ## Output Print _"YES"_ if it is possible for Captain to reach the treasure using the potion, otherwise print _"NO"_ (without quotes). [samples] ## Note In the first example there exists such sequence of moves: 1. — the first type of move 2. — the third type of move
Samples
Input #1
0 0 0 6
2 3
Output #1
YES
Input #2
1 1 3 6
1 5
Output #2
NO
API Response (JSON)
{
  "problem": {
    "name": "A. Treasure Hunt",
    "description": {
      "content": "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 tr",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF817A"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "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 tr...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments