The figure below shows a grid of 10 squares in a row. Each square has a diagonal connecting its lower left vertex to its upper right vertex. A bug moves along the line segments from vertex to vertex, never traversing the same segment twice and never moving from right to left along a horizontal or diagonal segment. Let N be the number of paths the bug can take from the lower left corner (A) to the upper right corner (B). One such path from A to B is shown by the thick line segments in the figure. Find N.