Not expert on this....but....
First one....we are only interested in the number of paths to "N" [ from here, there is only one way to get to O ]
Note that the movements that get us to N from A are ( right, up, up, up, up, up)
And in this set we can choose any 1 of the 6 positions for "right" = C(6, 1)....or...alternatively, any 5 of the 6 positions for "up".....so....the number of paths to N are C(6,1) = C(6,5) = 6 paths
Second one....again, we are only interested in getting to P
We have the following moves from A to P =
(R, R, R, R, R, U, U, U, U )
We can choose any 5 of 9 positions for R or, alternatively, any 4 of the 9 positions for U
So....the total paths are C(9, 5) = C(9,4) = 126 paths