Tuning of Terahertz Resonances of Pyridyl Benzamide Derivatives by Electronegative Atom Substitution