Of course you can. Fasting has been around since humans have been kicking about. It is not exclusively for weight loss. Fasting for weight loss is when you force a calorie deficit, if not you are just on a maintenance program. You will just have to make sure you are eating your daily recommended caloric intake. There are many, many benefits to fasting in general that aren’t linked to weight loss.
Edit: I didn’t calculate OP’s optimal weight and was told he is severely underweight. Ignore this.