Gratin of Endive and Ham (Adapted from a Bon Appetit recipe)