A polycomb-based switch underlying quantitative epigenetic memory