The key signature is not always a reliable guide to the key of a written piece. It does not discriminate between a major key and its relative minor; the piece may modulate to a different key; if the modulation is brief, it may not involve a change of key signature, being indicated instead with accidentals. Occasionally, a piece in a mode such as Mixolydian or Dorian is written with a major or minor key signature appropriate to the tonic, and accidentals throughout the piece.