Two York and North Yorkshire motorists have been banned for drug or drink driver and a third for using a mobile phone while driving by magistrates.