The key signature for B major is the least sharp key signature with three "lines" of sharps. In the treble clef, putting the sharp for A where it looks like it should be, next to the sharp for G, would mean that a ledger line would have to be used. In the bass clef it would be possible to do this without a ledger line, but because sight reading is easier when both staves look the same, it is not usually done in piano music. In the alto clef, used in orchestral music, the B major key signature is usually written in just two "lines" of sharps.