P, L, LL, A, AL, ALL, where P is the count of strings ending with 'P', L with 'L', LL with two 'L's, A with 'A', AL with 'A' and 'L', and ALL with 'A' and two 'L's.P = 1, L = 1, LL = 0, A = 1, AL = 0, ALL = 0.n (inclusive), updating the counts for each state based on the previous values.P, L, LL, A, AL, and ALL using the state transition rules.P, L, LL, A, AL, and ALL to get the total number of valid attendance records.10^9 + 7.