Demolitions have to be in accordance with law: SC on 'bulldozer action' in UP