Two lanes of a major North Yorkshire road are closed and traffic is stretching back for miles after a crash.