Alternatively, when the number of a second candidate group is 5, the number of a third candidate group is 56. In a third candidate group, an intra prediction mode having an index of 0?7 may be encoded with 5 bits and an intra prediction mode having an index of 8?55 may be encoded with 6 bits.