Rat In A Maze
View as PDF has a pet rat. He puts him in a square maze, with walls and pathways. He always puts him at the top left corner, and the exit is at the bottom right corner. The rat can move in the 4 directions left, right, up and down. The maze is composed of  numbers, of either 
0 or 1. 0 indicates the rat can move there, while a 1 indicates there is a wall and the rat cannot move there or pass through there. At the end of the maze, is a piece of cheese. The rat really loves cheese, help him get to the cheese!
Constraints
Input Specification
The first line contains an integer, , the size of the maze.
An  size grid, with 
0 and 1s.
Output Specification
Print out either yes or no, if the rat can reach the end of the maze or not.
Sample Input
4
0 0 1 1
0 0 0 1
0 0 1 0
0 1 0 0
Sample Output
no
Comments
For anyone wondering, the starting square will not contain a 1
Shouldn't this be labelled as graph theory?