Retired Putnam teacher agrees to 2 years in sexual exploitation case