Dual-Beam Intelligent Reflecting Surface for Millimeter and THz Communications