The present invention relates to compounds of the formula wherein R1 to R4 are as defined in the description and claims, and pharmaceutically acceptable salts thereof. The compounds are useful for the treatment and/or prophylaxis of diseases which are associated with the modulation of CB2 receptors.