def lscan; gets.split.map(&:to_i); end def solve(h,w,ay,ax,by,bx) return solve(w,h,ax,ay,bx,by) if h > w return true if w == 1 d = (ax-bx).abs + (ay-by).abs return true if d%2 == 1 false end h,w = lscan ay,ax = lscan by,bx = lscan puts solve(h,w,ay,ax,by,bx) ? 'Yes' : 'No'