Control of primary and subharmonic resonances of a Duffing oscillator via nonlinear energy sink