#include <bits/stdc++.h>
using namespace std;
long long int Mmax(long long int a, long long int b) {
  if (a > b) return a;
  return b;
}
long long int Mmin(long long int a, long long int b) {
  if (a < b) return a;
  return b;
}
long long int nod(long long int a, long long int b) {
  while (a && b) {
    if (a > b)
      a %= b;
    else
      b %= a;
  }
  return Mmax(a, b);
}
long long int nok(long long int a, long long int b) {
  return a * b / nod(a, b);
}
bool IsPrime(long long int x) {
  if (x < 2) return false;
  long long int X = sqrt(x), i;
  for (i = 2; i <= X; i++)
    if (x % i == 0) return false;
  return true;
}
void hanoi(int n, int A, int C, int B) {
  if (n == 1) {
    cout << n << " " << A << " " << C << endl;
  } else {
    hanoi(n - 1, A, B, C);
    cout << n << " " << A << " " << C << endl;
    hanoi(n - 1, B, C, A);
  }
}
string pr2(string a, int d) {
  if (d == 0) return "0";
  string b;
  long long int sz = a.size(), i, prenos = 0;
  for (i = 0; i < sz; i++) {
    b[i] = a[i];
  }
  for (i = sz - 1; i > -1; i--) {
    a[i] = ((b[i] - '0') * d + prenos) % 10 + '0';
    prenos = ((b[i] - '0') * d + prenos) / 10;
  }
  if (prenos) a = char(prenos + '0') + a;
  return a;
}
string sum(string a, string b) {
  bool carry = false;
  long long int i, sz1, sz2, maxsz, minsz;
  string c, d;
  sz1 = a.size();
  sz2 = b.size();
  maxsz = max(sz1, sz2);
  minsz = min(sz1, sz2);
  while (sz1 < maxsz) {
    sz1++;
    a = '0' + a;
  }
  while (sz2 < maxsz) {
    sz2++;
    b = '0' + b;
  }
  for (i = maxsz - 1; i > -1; i--) {
    d = char((a[i] + b[i] - 96 + carry) % 10 + 48) + d;
    if (a[i] + b[i] - 96 + carry > 9)
      carry = true;
    else
      carry = false;
  }
  if (carry == true) d = char('1') + d;
  return d;
}
string pr(string a, string b) {
  string res = "0", p, p2;
  int sz = a.size(), x = 0;
  for (sz = a.size(); sz > 0; sz--, x++) {
    int d = a[sz - 1] - '0';
    a = a.erase(sz - 1, 1);
    p2 = pr2(b, d);
    p2 += p;
    res = sum(res, p2);
    p += "0";
  }
  return res;
}
bool vesokosna(long long int x) {
  return (x % 4 == 0 && x % 100 || x % 400 == 0);
}
long long int reverse(long long int x) {
  long long int mirror = 0;
  while (x) {
    mirror = mirror * 10 + x % 10;
    x /= 10;
  }
  return mirror;
}
long long int ost(string x, long long int k) {
  long long int num = 0, i, sz = x.size();
  for (i = 0; i < sz; i++) {
    num = num * 10;
    num += x[i] - '0';
    num %= k;
  }
  return num;
}
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  if (c == 0) {
    if (a == b) {
      cout << "YES" << endl;
    } else
      cout << "NO" << endl;
    return 0;
  }
  int help = b - a;
  if (help % c == 0) {
    help /= c;
    if (help >= 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
    return 0;
  }
  cout << "NO" << endl;
  return 0;
}

### Prompt

Please formulate a Cpp solution to the following problem:

Vasya likes everything infinite. Now he is studying the properties of a sequence s, such that its first element is equal to a (s1 = a), and the difference between any two neighbouring elements is equal to c (si - si - 1 = c). In particular, Vasya wonders if his favourite integer b appears in this sequence, that is, there exists a positive integer i, such that si = b. Of course, you are the person he asks for a help.

Input

The first line of the input contain three integers a, b and c ( - 109 ≤ a, b, c ≤ 109) — the first element of the sequence, Vasya's favorite number and the difference between any two neighbouring elements of the sequence, respectively.

Output

If b appears in the sequence s print "YES" (without quotes), otherwise print "NO" (without quotes).

Examples

Input

1 7 3


Output

YES


Input

10 10 0


Output

YES


Input

1 -4 5


Output

NO


Input

0 60 50


Output

NO

Note

In the first sample, the sequence starts from integers 1, 4, 7, so 7 is its element.

In the second sample, the favorite integer of Vasya is equal to the first element of the sequence.

In the third sample all elements of the sequence are greater than Vasya's favorite integer.

In the fourth sample, the sequence starts from 0, 50, 100, and all the following elements are greater than Vasya's favorite integer.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
long long int Mmax(long long int a, long long int b) {
  if (a > b) return a;
  return b;
}
long long int Mmin(long long int a, long long int b) {
  if (a < b) return a;
  return b;
}
long long int nod(long long int a, long long int b) {
  while (a && b) {
    if (a > b)
      a %= b;
    else
      b %= a;
  }
  return Mmax(a, b);
}
long long int nok(long long int a, long long int b) {
  return a * b / nod(a, b);
}
bool IsPrime(long long int x) {
  if (x < 2) return false;
  long long int X = sqrt(x), i;
  for (i = 2; i <= X; i++)
    if (x % i == 0) return false;
  return true;
}
void hanoi(int n, int A, int C, int B) {
  if (n == 1) {
    cout << n << " " << A << " " << C << endl;
  } else {
    hanoi(n - 1, A, B, C);
    cout << n << " " << A << " " << C << endl;
    hanoi(n - 1, B, C, A);
  }
}
string pr2(string a, int d) {
  if (d == 0) return "0";
  string b;
  long long int sz = a.size(), i, prenos = 0;
  for (i = 0; i < sz; i++) {
    b[i] = a[i];
  }
  for (i = sz - 1; i > -1; i--) {
    a[i] = ((b[i] - '0') * d + prenos) % 10 + '0';
    prenos = ((b[i] - '0') * d + prenos) / 10;
  }
  if (prenos) a = char(prenos + '0') + a;
  return a;
}
string sum(string a, string b) {
  bool carry = false;
  long long int i, sz1, sz2, maxsz, minsz;
  string c, d;
  sz1 = a.size();
  sz2 = b.size();
  maxsz = max(sz1, sz2);
  minsz = min(sz1, sz2);
  while (sz1 < maxsz) {
    sz1++;
    a = '0' + a;
  }
  while (sz2 < maxsz) {
    sz2++;
    b = '0' + b;
  }
  for (i = maxsz - 1; i > -1; i--) {
    d = char((a[i] + b[i] - 96 + carry) % 10 + 48) + d;
    if (a[i] + b[i] - 96 + carry > 9)
      carry = true;
    else
      carry = false;
  }
  if (carry == true) d = char('1') + d;
  return d;
}
string pr(string a, string b) {
  string res = "0", p, p2;
  int sz = a.size(), x = 0;
  for (sz = a.size(); sz > 0; sz--, x++) {
    int d = a[sz - 1] - '0';
    a = a.erase(sz - 1, 1);
    p2 = pr2(b, d);
    p2 += p;
    res = sum(res, p2);
    p += "0";
  }
  return res;
}
bool vesokosna(long long int x) {
  return (x % 4 == 0 && x % 100 || x % 400 == 0);
}
long long int reverse(long long int x) {
  long long int mirror = 0;
  while (x) {
    mirror = mirror * 10 + x % 10;
    x /= 10;
  }
  return mirror;
}
long long int ost(string x, long long int k) {
  long long int num = 0, i, sz = x.size();
  for (i = 0; i < sz; i++) {
    num = num * 10;
    num += x[i] - '0';
    num %= k;
  }
  return num;
}
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  if (c == 0) {
    if (a == b) {
      cout << "YES" << endl;
    } else
      cout << "NO" << endl;
    return 0;
  }
  int help = b - a;
  if (help % c == 0) {
    help /= c;
    if (help >= 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
    return 0;
  }
  cout << "NO" << endl;
  return 0;
}

```