class Rect
    def initialize(*args)
        @x1, @y1, @x2, @y2 = args
    end

    def include?(x, y)
        (@x1 <= x && x <= @x2) and (@y1 <= y && y <= @y2) 
    end

    def corners
        [
            [@x1, @y1],
            [@x2, @y1],
            [@x1, @y2],
            [@x2, @y2],
        ]
    end

    def intersect?(r)
        self.corners.any?{|x, y| r.include?(x, y)} or r.corners.any?{|x, y| self.include?(x, y)}
    end
end

while l = gets
    a = l.chomp.split.map(&:to_f)
    r1 = Rect.new(*a[0..3])
    r2 = Rect.new(*a[4..7])
    puts r1.intersect?(r2) ? 'YES' : 'NO'
end

