YG’s vehicle ended up in someone’s front yard outside L.A. Tuesday afternoon, and from the looks of the scene … he’s damn lucky to have avoided a major injury.

His car — a Chevy Suburban — is sitting smack in the middle of someone’s front yard, and it’s a mystery as to what happened. TMZ has photos and video from the scene … where YG is standing near the wreckage. The accident went down in the San Fernando Valley.

The rapper was a passenger, riding in the back of the Uber-driven ride, and there were no other vehicles involved in the accident.

It’s still unclear what happened to the driver … or why he went off the road.