Hidoku

Hidoku (Hidato) is a Japanese logic puzzle. Find a path in the grid that passes through all the cells in the correct order, exactly once.

Hidoku

Rules: Each cell of the N×M grid must contain a number from the range 1 to N×M.
Each number must be used only once. Consecutive numbers must be adjacent to each other orthogonally or diagonally.