Section A is from bars 1-16 bt.1 and Section B is from bar 16 bt.2-40
the first note is the tonic of B minor; a B chord
In bar 7 a G# is put in, indicating a modulation to A major or F# minor, and in bar 8 an E# confirms F# minor. F# minor is the dominant minor of B minor, aka a related key. Section A ends in F# minor