The upper shaft section is 28mm, lower 30mm. BMW have 28mm on both.
The main area of concern when doing a swap like this is bearing
cup outer diameter. Lucky the Yamaha and BMW have the same size cup outer diameter. So, all you need to do is get a headstem bearing kit for a Yamaha YZ/WR.
Down in the land of the confused(mainly me