Is ham frozen for two years safe to eat?

Yes, it's safe, but probably freezer burned which takes much of the taste out of any meat. If you don't want to waste the ham then make ham and pea soup from it. The ham will pick up the taste of the carrots, onion and green peas.