def rectanglesOverlap(r1, r2):
    """Check whether r1 and r2 overlap."""
    if ((r1[0] >= r2[0] + r2[2]) or (r1[0] + r1[2] <= r2[0])
            or (r1[1] + r1[3] <= r2[1]) or (r1[1] >= r2[1] + r2[3])):
        return False
    else:
        return True