Using a mandoline, slice the potatoes crosswise 1/8 inch thick. In a small bowl, combine the pecorino and Parmigiano cheese. Arrange one fourth of the potato slices in the prepared baking dish, overlapping them slightly. Sprinkle 1/4 cup of the cheese, 1 tablespoon of the parsley and one third of the ham over the potatoes. Repeat the layering two more times. Top with a final layer of potatoes and sprinkle with the remaining 1/4 cup of cheese. Pour the cream mixture over and around the potatoes.