You could also do this with an array. This will also allow one to add different flare types (addon flares) very easily by adding those to the array. Here's how:
_flaretypes = ["flare", "flarered", "flaregreen", flareyellow"]
if (not (_projectile in _flaretypes)) then {exit}
or you can put the if-then in short hand
? ! (_projectile in _flaretypes) : exit
If someone makes a purple flare called "flarepurple", then that can be added to the array.