The rooms of a building are arranged in a $m\times n$ rectangular grid (as shown below for the $5\times 6$ case). Every room is connected by an open door to each adjacent room, but the only access to or from the building is by a door in the top right room. This door is locked with an elaborate system of $mn$ keys, one of which is located in every room of the building. A person is in the bottom left room and can move from there to any adjacent room. However, as soon as the person leaves a room, all the doors of that room are instantly and automatically locked. Find, with proof, all $m$ and $n$ for which it is possible for the person to collect all the keys and escape the building.


[asy]
unitsize(5mm);
defaultpen(linewidth(.8pt));
fontsize(25pt);
for(int i=0; i<=5; ++i)
{
for(int j=0; j<= 6; ++j)
{
draw((0,i)--(9,i));
draw((1.5*j,0)--(1.5*j,5));
}}
dot((.75, .5));
label("$\ast$",(8.25,4.5));

dot((11, 3));
label("$\ast$",(11,1.75));
label("room with locked external door",(18,1.9));
label("starting position",(15.3,3));

[/asy]
1. **Claim**: If either \( m \) or \( n \) is odd, the person can escape.
   
   - **Proof**: Assume one of \( m \) or \( n \) is odd. The person can follow a "snaking" path, moving from one room to the next in a continuous manner, filling one column at a time. This ensures that every room is visited exactly once, and the person can reach the top right room and escape.

2. **Claim**: If both \( m \) and \( n \) are even, it is impossible for the person to collect all the keys and escape.

   - **Proof**: We use a parity argument to show this. Consider the coordinates of the rooms in the grid. The bottom left room is at \((1, 1)\) and the top right room is at \((m, n)\).

   - **Lemma**: If \( m \) and \( n \) have the same parity, all paths from the starting point \((1, 1)\) to the ending point \((m, n)\) cover an odd number of rooms, including the starting and ending rooms. If \( m \) and \( n \) have different parities, all paths cover an even number of rooms.

   - **Base Case**: For a \(1 \times 2k\) grid, any path from \((1, 1)\) to \((1, 2k)\) covers \(2k\) rooms, which is even. For a \(1 \times (2k+1)\) grid, any path from \((1, 1)\) to \((1, 2k+1)\) covers \(2k+1\) rooms, which is odd.

   - **Inductive Step**: Assume the lemma holds for all grids of size \(a \times b\) where \(a \leq m\) and \(b \leq n\), except for \((m, n)\). To reach \((m, n)\), the path must go through \((m-1, n)\) or \((m, n-1)\). The parity of \((m, n)\) is opposite to the parity of \((m-1, n)\) and \((m, n-1)\). This ensures that the parity of the number of rooms visited changes as we move from \((m-1, n)\) or \((m, n-1)\) to \((m, n)\).

   - **Conclusion**: When \(m\) and \(n\) are both even, the total number of rooms \(mn\) is even. However, any path from \((1, 1)\) to \((m, n)\) must cover an odd number of rooms, which means it is impossible to visit all rooms exactly once and end at \((m, n)\).

The final answer is \( \boxed{\text{True if either } m \text{ or } n \text{ is odd; False if both } m \text{ and } n \text{ are even}} \)