Leader Wang gets lost when he is walking in NB school.Now,there are many brands in the road.There will include the direction in brand(East, South, West and North).NB school is the size of M * N,and leader will follow the direction in brand,like map1 and map2.Can leader walk out of the map?
If leader can walk out of the map,output "YES",else output "NO".