beecrowd | 1773
# Locked in the Castle

**Timelimit: 1**

By Cristhian Bonilha, UTFPR Brazil

You are locked inside a castle with **N** rooms and **M** corridors. The rooms are numbered with numbers between 1 and **N**, and you are initially at the room number 1. Each of the **M** corridors connects two distinct rooms. To try to leave you decided to visit all of the **N** rooms of the castle.

All of the rooms, with exception of the room number 1 where you are, need a key to be visited. You had luck to find some notes in the ground, saying where all of these keys are. For exemple, be S and D two distinct rooms, to visit the room D you need to first visit the room S that has the key to open the room S.

Given the information about the rooms, corridors and the key locations, find out if it's possible to visit all of the rooms of the castle.

There will be at most 70 test cases. Each test case starts with two integers **N** and **M**, indicating the number of rooms and corridors of the castle (2 ≤ **N** ≤ 10^{3}, 1 ≤ **M** ≤ 10^{4}).

Following there will be **M** lines containing two integers **A** and **B** each, indicating that there's a corridor that connects the room **A** and **B**, which can be traversed in both directions (1 ≤ **A**, **B** ≤ **N**).

Following there will be **N-1** integers **k _{2}**,

The input ends with end of file (EOF).

If it's possible to visit all of the rooms of the castle print the word “sim”, otherwise print the word “nao”.

Input Sample | Output Sample |

4 3 |
sim |