Efficient operation of a cavity dumped Q-switched and mode-locked YAG laser