One of the easy ways to find out a key with flats is to see what the penultimate flat is. This will give you the major key! E.g. if there are 5 Flats in a key signature (B, E, A, D, G) just take the penultimate flat (D flat) and you have the key which is D flat major!