Can you breastfeed pregnant?

So my birth control failed me and baby number 2 is cooking 😅 wondering if it’s okay for me to still breastfeed my first baby while being pregnant? Idk why it wouldn’t be but also I’m not super educated on this stuff so i figured I’d ask. Right now we breastfeed about 50/50 with formula but I really wanted to feed up to a year or more.