Copy input file based on condition

Hi,

I am new to unix shell programming.

I want to write a shell script for a functionality existing in mainframe system.

I have one file as below as input

123456
&__987
&12yuq
abcdef

_ referes to blank
condition:whenever the input file is having &__ ,it should be replaced with
blanks ___. rest of the file should be copied.
Other records should be copied as it is to the output file.

The output file should be as below
123456
___987
&12yuq
abcdef

Please help out with a shell script sample

Thanks

something like this :

sed 's/&__/___/' input_file > output_file

Thanks Panyam.
It is working but

if the input record is like this it should not convert,but it is converting.

for example

abc&__123

should be
abc&__123

but it is converted
abc___123

Basically it should convert only when & is occuring in first field.

sed 's/^&__/___/' input_file > output_file

Thanks Frans

It is working fine