F. Fighting Fraud
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output

Picture of a GCPC courier. They are extremely discreet.

Got a job for you. This shady business called Guaranteed Clandestine Private Couriers is trying to hide something. Their public filings and tax records are spotless. As clean as a doctor's hands just before surgery. And you know what that means. They had dirt to scrub off, I'm sure of it. Got my hands on one of their drivers' delivery schedules. You know, a list of tasks to discreetly pick up and deliver an item. I bet we find something off with the schedule. Maybe an item that is picked up but never delivered. Maybe a delivery of something with no records where it came from. Heck, they might even list an item for some task long after the item has been delivered to keep the actual cargo off the books. Anyway, find out if the schedule is legit. If each item mentioned in the schedule is picked up and delivered exactly once, then the guy who cooks their books must be a genius. Guess they are paying him well. Speaking of, this one's double your regular fee. Half upfront for your discretion and the rest when I have your report. Don't call unless you're done!

Input

The input consists of:

  • One line with an integer $$$n$$$, the length of the schedule ($$$1\leq n\leq 10^5$$$).
  • The next $$$n$$$ lines each describe a schedule task, the $$$i$$$th of which contains:
    • The string "pickup" or "dropoff".
    • A string $$$a_i$$$ consisting of English lowercase letters (a-z), the identifier of the item related to the $$$i$$$th task ($$$1\leq |a_i| \leq 20$$$, $$$\sum |a_i| \leq 10^6$$$).
Output

Output "yes" if the schedule is valid and "no" otherwise.

Examples
Input
4
pickup apples
pickup oranges
dropoff oranges
dropoff apples
Output
yes
Input
6
pickup gcpc
pickup teams
dropoff gcpc
pickup jury
dropoff teams
dropoff gcpc
Output
no
Input
2
dropoff books
pickup books
Output
no
Input
4
pickup balloon
dropoff balloon
pickup balloon
dropoff balloon
Output
no
Input
1
dropoff fft
Output
no
Input
4
pickup timelimit
pickup correct
dropoff timelimit
dropoff correct
Output
yes