Boil yams with water to cover. When boiling point is reached, add sugar and pineapple. Boil without stirring for 20 minutes or until soft. Strain and reserve syrup.
Mash yams and pineapple until smooth. Add syrup and mix well. Cook 5 minutes. Place in serving dishes and chill or serve at room temperature.