#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int a, b, c;
  cin >> a >> b >> c;
  int sum, tru = 0;
  if ((a < 0 && b < 0 && c < 0) || (a >= 0 && b >= 0 && c >= 0)) {
    sum = abs(b) - abs(a);
    if (sum > 0) {
      if (c != 0) {
        if (sum % abs(c) == 0) tru = 1;
      }
    } else if (sum == 0)
      tru = 1;
  } else if ((a >= 0 && b >= 0 && c < 0) || (a < 0 && b < 0 && c >= 0)) {
    sum = abs(a) - abs(b);
    if (sum > 0) {
      if (c != 0) {
        if (sum % abs(c) == 0) tru = 1;
      }
    } else if (sum == 0)
      tru = 1;
  } else if ((a < 0 && b >= 0 && c >= 0) || (a >= 0 && b < 0 && c < 0)) {
    sum = abs(a) + abs(b);
    if (sum > 0) {
      if (c != 0) {
        if (sum % abs(c) == 0) tru = 1;
      }
    } else if (sum == 0)
      tru = 1;
  }
  if (tru == 1)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
