How to add custom value prefix in order and invoice number

I like to add prefix in order and invoice number and next number should be in current year and last 4 digit is Increment number, this are all without extension.

Example: 0001 to CCC-yy0001