A man has been seriously injured and airlifted to hospital after a crash in North Yorkshire.