A decoding device may obtain remaining mode information through a bitstream. An intra prediction mode of a current block may be decoded based on the remaining mode information. The decoding may be performed based on at least one of the number of the second candidate group, an arrangement position of a second candidate group within the non-MPM or a value of remaining mode information. Also, the decoding may further include a process in which the MPM/the second candidate group are arranged in an ascending order and compared as shown in 
In an example, it is assumed that the number of the second candidate group is 5 and a second candidate group is positioned behind a third candidate group.
If the remaining mode information has a value of 56 to 60, a decoding device may determine an intra prediction mode corresponding to a value of the remaining mode information. The determined intra prediction mode may be set as an intra prediction mode of a current block.