n,m=map(int,input().split()) x,y=map(int,input().split()) print("YES"if x%m==y%m else"NO")