Dendroctonus

Decide whether the infected and non-infected points can be separated by a single circle centered anywhere, where boundary non-infected points are allowed but interior ones are not.

Hard8GeometryBrute forceImplementationMathNo attempts yetTime limit8sMemory limit512 MB

Problem

Mountain pine beetles (Dendroctonus ponderosae) are small pests that bore into trees and cause a huge amount of damage. Their population has grown sharply, and scientists want to know where the outbreak started. In particular, they want to know whether there was a single outbreak or several of them. If there is more than one outbreak, they must raise the alert level.

In one outbreak the beetles start at a single location, called the initial infection point, and slowly work their way outwards. A tree inside the infection area is infected. A tree outside the infection area is not infected. A tree on the boundary of the infection area may or may not be infected. The infection area is always a circle centred at the initial infection point.

You are given the locations of the infected and the non-infected trees. Decide whether there is enough evidence to raise the alert level.

Input

The first line contains one integer nn (1n1001 \le n \le 100), the number of trees.

Each of the next nn lines describes one tree. The line contains two integers xx (250x250-250 \le x \le 250) and yy (250y250-250 \le y \le 250), the location of the tree, and one character pp that tells whether the tree is infected. If pp is I, the tree is infected. If pp is N, the tree is not infected. Trees are single points on the plane. The initial infection point of an outbreak does not have to be a tree and does not have to be at integer coordinates. The nn trees are at distinct locations.

Output

Print Yes if more than one outbreak is guaranteed, and No otherwise.

A single outbreak explains the observation when some circle holds every infected tree in its interior or on its boundary and holds no non-infected tree in its interior.