A non-transitory computer-readable medium including a program for decoding a current block, the program, when executed by a processor, causing the processor to perform processes, the processes comprising:
- deriving a first candidate from a first motion vector that has been used to decode a first block;
- determining whether a total number of one or more candidates including the first candidate is less than a maximum candidate number;
- deriving a second candidate having a second motion vector after deriving the first candidate when the total number of the one or more candidates including the first candidate is less than the maximum candidate number, the second motion vector including a zero vector;
- selecting a candidate from a plurality of candidates, the plurality of candidates including the first candidate and the second candidate;
- and
- decoding the current block using the selected candidate.