Contextual Filters using YYYY and MM
I have done this by setting up two displays of my view

Display 1 is a page display, with the path 'foo/date/%/%'.  This then gets a pair of contextual filters, the first is for the year (the first argument).  The second is for the month (the second argument).

Display 2 is a page display, with the path 'foo/date/%'.  This gets a single contextual filters, the year.