Vasya likes everything infinite. Now he is studying the properties of a sequence s, such that its first element is equal to a (s_1 = a), and the difference between any two neighbouring elements is equal to c (s_{i} - s_{i} - 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 s_{i} = 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 ( - 10^9 ≤ a, b, c ≤ 10^9) — 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.

Difficulty: interview

Starter code:

Solutions:
import sys
a,b,c=map(int,input().split())
if c==0:
    if a==b:
        print('YES')
    else:
        print('NO')
    return
if (b-a)%c==0 and (b-a)//c>=0:
    print('YES')
else:
    print('NO')

a, b, c = list(map(int, input().split()))
if c != 0:
    if c * (b - a) >= 0 and (b - a) % c == 0:
        print('YES')
    else:
        print('NO')
else:
    if b == a:
        print('YES')
    else:
        print('NO')


a, b, c = list(map(int, input().split()))

if c != 0:
    n = (b - a) // c
else:
    n = 0
print(["NO", "YES"][(a + n * c == b) and (n >= 0)])


# You lost the game.
a,b,c = list(map(int, input().split()))
if (c == 0 and b == a):
    print("YES")
elif (c == 0):
    print("NO")
elif (b-a) % c == 0 and ((c >= 0 and b >= a) or (c <= 0 and b <= a)):
    print("YES")
else:
    print("NO")


a, b, c = list(map(int, input().split()))
if c == 0:
    if b == a:
        print('YES')
    else:
        print('NO')
else:
    if (b - a) % c == 0 and (b - a) // c >= 0:
        print('YES')
    else:
        print('NO')


a,b,c = map(int, input().split())

if c == 0 :
    ans = (a == b)
else :
    k = (b - a)//c
    ans = (k >= 0 and a + c*k == b)

if ans :
    print("YES")
else :
    print("NO")

a, b, c= [int(i) for i in input().split()]
if (a < b and c<=0) or (a > b and c>=0):
	print("NO")
else:
	if a == b:
		print("YES")
	else:
		if c == 0:
			print("NO")
		else:
			if (b-a)%c == 0:
				print("YES")
			else:
				print("NO")


#!/usr/bin/env python3
import math
a, b ,c = list(map(int, input().split()))
if (b > a and c <= 0) or (b < a and c >= 0): print('NO')
elif b == a: print('YES')
else :
    print('YES' if abs(b - a) % abs(c) == 0 else 'NO')


a,b,c=map(int,input().split())
if c==0: 
    print('YES' if b==a else 'NO')
else:
     if (b-a)%c==0 and (b-a)//c>=0: print('YES')
     else: print('NO')

a,b,c=[int(x) for x in input().split()]
if c==0:
    if b!=a:
        print("NO")
    else:
        print("YES")
else:
    if c<0:
        c=-c
        d=a
        a=b
        b=d
    if b>=a and (b-a)%c==0:
        print("YES")
    else:
        print("NO")


a, b, c = map(int, input().split())
if c == 0 and b == a or c != 0 and (b - a) % c == 0 and (b - a) // c >= 0:
    print("YES")
else:
    print("NO")

a, b, c = list(map(int, input().split()))
if c > 0:
  if b >= a and a % c == b % c:
    print('YES')
  else:
    print('NO')
elif c == 0:
  if b == a:
    print('YES')
  else:
    print('NO')
else:
  if b <= a and a % c == b % c:
    print('YES')
  else:
    print('NO')


a,b,c = list(map(int, input().split()))
 
if b - a > 0 and c > 0:
    if (b - a) % c == 0:
        print("YES")
    else:
        print("NO")
elif b - a < 0 and c < 0:
    if (b - a) % c == 0:
        print("YES")
    else:
        print("NO")
elif a - b == 0:
    print("YES")
else:
    print("NO")


a, b, c = list(map(int, input().split()))

if((c == 0 and a == b) or (c > 0 and a % c == b % c and b >= a) or (c < 0 and
    a%c == b%c and b <= a)):
    print("YES")
else:
    print("NO")


a, b, c = map(int, input().split())
if c == 0:
	if a == b:
		print("YES")
	else:
		print("NO")
else:
	d, r = divmod(b - a, c)
	if a == b:
		print("YES")
	else:
		if d < 1 or r != 0:
			print("NO")
		else:
			print("YES")

a,b,c = input().split()
a = int(a)
b = int(b)
c = int(c)
if (a == b) or ((c > 0 and a < b or c < 0 and a > b) and a % c == b % c):
    print('YES')
else:
    print('NO')


a,b,c=list(map(int,input().split()))

if c==0:
    if a==b:
        print('YES')
    else:
        print('NO')
else:
    k=(b-a)/c
    if int(k)-k==0.0 and k>=0:
        print("YES")
    else:
        print('NO')


a, b, c = list(map(int, input().split()))
if c == 0:
    print("YES" if a == b else "NO")
else:
    print("YES" if (b - a + c) % c == 0 and (b - a + c) // c > 0 else "NO")


#!/usr/bin/env python3

def main():
    a, b, c = [int(x) for x in input().split()]
    if a == b:
        print('YES')
    elif c == 0:
        print('YES' if (b == a) else 'NO')
    else:
        n = (b - a) // abs(c)
        x = (b - a) % abs(c)
        print('YES' if x == 0 and n * c > 0 else 'NO')

def __starting_point():
    main()

__starting_point()

#!/usr/bin/env python3

try:
    while True:
        a, b, c = list(map(int, input().split()))
        if c == 0:
            print("YES" if a == b else "NO")
        elif c > 0:
            print("YES" if b in range(a, int(1e10), c) else "NO")
        else:
            print("YES" if b in range(a, int(-1e10), c) else "NO")

except EOFError:
    pass


a,b,c = list(map(int,input().split()))
if c == 0:
    if b == a:
        print('YES')
    else:
        print('NO')
elif c > 0:
    if b < a:
        print('NO')
    else:
        if a%c == b%c:
            print('YES')
        else:
            print('NO')
else:
    if b > a:
        print('NO')
    else:
        if a%c == b%c:
            print('YES')
        else:
            print('NO')


a,b,c=map(int,input().split())
if c == 0:
    print("YES" if b-a == c else "NO")
elif (b-a) % c == 0 and (b-a) / c >= 0:
    print("YES")
else:
    print("NO")

a, b, c = map(int, input().split())
if (c and not (a - b) % c and max(a + c, b) - min(b, a + c) < max(a, b) - min(a, b)) or (a == b):
    print('YES')
else:
    print('NO')

read = lambda: list(map(int, input().split()))
a, b, c = read()
if c == 0 and (b == a): ans = 'YES'
elif c != 0 and (b - a) % c == 0:
    if c > 0 and b >= a: ans = 'YES'
    elif c < 0 and b <= a: ans = 'YES'
    else: ans = 'NO'
else: ans = 'NO'
print(ans)