UN warns of losing opportunity for two-state solution