Can I be compensated according to EU Regulation 261/2004 if my flight is canceled?

Can I be compensated according to EU Regulation 261/2004 if my flight is canceled?