Modify the CYK (Cocke-Younger-Kasami) algorithm so can report the number of distinct parse trees for the given input, rather than just reporting membership in the language.

Note: The CYK algorithm tells whether a given string is in a given context free language.